Posts

Showing posts with the label json

Validating and deserializing json-ld

Validating and deserializing json-ld I am looking into json and json-ld for the first time and I am unsure about which libraries to use for what I want to achieve, hoping for some advice from those who are more proficient in these topics. Simply put: I am extracting json-ld objects from HTML. I want to validate them against their schema.org schema, then deserialize them into POCOs. What I found so far: Having said all that, can anybody recommend a way / libraries to validate and deserialize json-ld? Looking at json-ld for.NET being out for 2 years already with no implementation activity showing up on github, what are people using to work with json-ld on the.NET platform? Further info: target framework is xamarin. @TheGeneral me too. But does it support json-ld as well? – quaylar Jun 30 at 9:38 Ahh ok sorry i misu...

POST fails with Retrofit (connect timed out) but works with Postman [on hold]

Image
POST fails with Retrofit (connect timed out) but works with Postman [on hold] SOLVED: stupid mistake, I had https://foo.foo.com:433 instead of https://foo.foo.com:443... I've implemented Retrofit and I'm trying to send a POST request with JSON data as JsonObject. It's not working and I get a failure "connect time out", but I can send a POST request without problem via Postman. At first I thought it was because of the header, I've tried with an Interceptor and to use @Header instead of @Headers. Thank you for your help. Postman Log from HttpLoggingInterceptor() Jun 30, 2018 10:22:09 AM okhttp3.internal.platform.Platform log INFO: --> POST https://foo.foo.com:433/ Jun 30, 2018 10:22:09 AM okhttp3.internal.platform.Platform log INFO: Content-Type: application/json Jun 30, 2018 10:22:09 AM okhttp3.internal.platform.Platform log INFO: Content-Length: 132 Jun 30, 2018 10:22:09 AM okhttp3.internal.platform.Platform log INFO: Jun 30, 2018 10:22:09 AM okhttp3.inter...

ArrayList.add not working with AsyncTask

ArrayList.add not working with AsyncTask I'm using fragment view to show ListView in my Android Application. It is working perfectly when I manually enter ArrayList . But now I want to add JSON array to the ArryList in AsyncTask class and add that ArrayList to Adapter. ListView ArrayList ArryList AsyncTask ArrayList So I got JSON array and put It ArrayList . This process doing in the AsyncTask class. ArrayList AsyncTask I execute that AsyncTask class in onCreateView() method in Fragment. Then I set ArrayList to Adapter. But problem is there.. AsyncTask onCreateView() ArrayList After execute AsyncTask class get my JSON array perfectly and add to the ArrayList . But when I try to add my ArrayList to Adapter. Then my ArryaList empty. AsyncTask ArrayList ArrayList ArryaList This my fragment class with AsyncTask Part AsyncTask public class FragmentCategory extends Fragment { private ListView lvCategory; private CategoryAdapter categotyAdapter; private List<Category> mC...

how to define the intra-dependencies within JSON elements?

how to define the intra-dependencies within JSON elements? Let's say I have the following JSON which defines an API: {"contract_name": "create_user", "method": "POST", "url": "/users", "request_body": { "username": { "type": "email", "options": "None", "required": "true", "unique":"true" }, "role": { "type": "string", "options": [ "TESTER", "RA_DEVICE" ], "required": "true" }, "userProfile": { "type": "object", "options": { ...

Concatenating with data from json when I change option

Concatenating <select> with data from json when I change option I wrote some code to get <select> s from a Json file. My code generates new selections according to the Json levels available: I have a first selection and, if the option selected has a second selection concatenated, a new <select> comes out with its options. It goes ahead until I reach the "leaf" of the tree. Everything is good so far. Anyway, if I change the option of the previous select, I get one more select appended to the latest one. What I need, instead, is to change the values of the latest option according to the changings of the previous one I made. <select> <select> Example 1 --> 1.1 --> 1.1.1 If I turn "1.1" into "1.2" I get: 1 --> 1.2 --> 1.1.1 --> 1.2.1 . What i want to get is: 1 --> 1.2 --> 1.2.1 Just to get you right. You currently have, fort example, 1 -> 1.1 -> 1.1.1 and you then turn 1.1 ...

Parse JSON in Swift 24hours of problems

Parse JSON in Swift 24hours of problems I am really struggling to parse a json file into my iOS app in Swift. I have a JSOn output from an SQL db. I think the formatting is wrong and the data headers are a bit ambiguous but my developer who I hired to create the process is happy with the output. Link below. So in the last 3 days I have read all of the Apple Developer materials on parsing JSON, also watched numerous tutorials which all cover pretty much the same data, and I don't know how much I have read and converted into actual projects which have all failed. I am really needing some guidance here. I have even in a desperate attempt to understand my problem from a different perspective I have looked at how it is done in other languages. This is the latest iteration: func flightData()-> [[String: String]]{ let url = URL(string: "http://35.237.114.234/api/index.php?uid=Bx7faf08A9fYJ7bZCNMUX9EzxYN2") guard let jsonFileURL = Bundle.main.url(forResource: "jso...

I want to parse the JSON array to grid view parsing is done but Error raising in gridview adapter

I want to parse the JSON array to grid view parsing is done but Error raising in gridview adapter Here I attached my whole code to make this clear and to understand the error Below is my Parsing code using Volley private void getData() { final ProgressDialog loading = ProgressDialog.show(this,"Loading","please wait",false,false); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET,DATA_URL,null,new Response.Listener<JSONObject>(){ @Override public void onResponse(JSONObject response) { loading.dismiss(); showGrid(response.optJSONArray("data")); } }, new Response.ErrorListener(){ @Override public void onErrorResponse(VolleyError error) { loading.dismiss(); Toast.makeText(getApplicationContext(),error.getMessage()+",hello everybody",Toast.LENGTH_LONG).show(); } } ); ...