How to parse json c site
I tried through jsonschema2pojo , I can’t insert a piece of json

 { "meta": { "code": 200, "api_version": "2.0.1.6.0", "issue_date": "20160515" }, "result": { "total": 109, "items": [{ "name": "Dubai. Sharjah. Ajman", "flags": { "public_transport": true, "metro": true, "road_network": true, "flamp": false }, "domain": "ae", "bounds": "POLYGON((54.86679 24.763287,55.680597 24.763287,55.680597 25.51707,54.86679 25.51707,54.86679 24.763287))", "zoom_level": { "min": 9, "max": 18 }, "code": "dubai", "country_code": "ae", "id": "99", "type": "region", "time_zone": { "name": "Asia/Dubai", "offset": 240 } }, { "name": "Lefkosia", "flags": { "public_transport": true, "metro": false, "road_network": true, "flamp": false } 

I put checkmarks Json, GSON , use primative types Use double numbers , nclude getters and setters , Allow additional properties .
I get the error:

There's a problem: Unexpected end-of-input: expected close marker for OBJECT (from [Source: java.io.StringReader@30a7202; line: 31, column: 5]) (line 38, column 923)

    1 answer 1

    It is not possible to take an arbitrary start from JSON and expect it to turn out to be a correct JSON. jsonschema2pojo.org swears at the incorrect JSON that you are trying to feed him. At a minimum, it is required that the balance of brackets (both curly and square) come together - if the list somewhere begins with [ , it should end somewhere with ] (the comma separates the list elements), similarly with objects: begin with { , end with } , properties are separated by commas, property name from value is a colon.

    I recommend reading a little about what JSON is , after that it will probably become clearer why something you are trying to insert is incorrect.

    I would recommend to trim JSON only after a full description of a certain country of the country and keep all closing brackets, for example:

     { "meta": { "code": 200, "api_version": "2.0.1.6.0", "issue_date": "20160515" }, "result": { "total": 109, "items": [{ "name": "Dubai. Sharjah. Ajman", "flags": { "public_transport": true, "metro": true, "road_network": true, "flamp": false }, "domain": "ae", "bounds": "POLYGON((54.86679 24.763287,55.680597 24.763287,55.680597 25.51707,54.86679 25.51707,54.86679 24.763287))", "zoom_level": { "min": 9, "max": 18 }, "code": "dubai", "country_code": "ae", "id": "99", "type": "region", "time_zone": { "name": "Asia/Dubai", "offset": 240 } }] } }