Questions tagged [jsonschema2pojo]

The jsonschema2pojo is a tool that takes a json schema document and generates DTO-style Java classes (in the form of .java source files).

The jsonschema2pojo is a tool that takes a JSON Schema or JSON document and generates DTO-style Java classes (in the form of .java source files).

There are currently six ways to use jsonschema2pojo:

  1. as a maven plugin
  2. via the command line
  3. as an ant task
  4. as a gradle plugin
  5. directly from your code (embedded) using jsonschema2pojo-core
  6. from the website
174 questions
0
votes
2 answers

Cannot get latitude and longitude from Google Maps using Retrofit

I have defined a Model class along with an interface inside it. The code is as follows: public class MapModel { MapContract.Presenter mPresenter; private Location mResLocation; private static final String TAG =…
0
votes
1 answer

Autogenerate primitive byte array generics with jsonschema2pojo

Is there a way to autogenerate java classes from json with jsonschema2pojo where the generics include a primitive byte array? For example i want to generate this private Map mappy; and so far I managed to generate private Map
corneliu
  • 656
  • 13
  • 37
0
votes
1 answer

How to parse json array using retrofit?

My response is like this.. { "IsSuccess": true, "ResponseObject": ["one", "two", "three", "four", "five"] }} i tried to do by creating POJO. Kindly help me with the solution.
Bakyaraj
  • 35
  • 5
0
votes
1 answer

Android Nested Data Modeling

I have the following contract "shape": { "type": "MultiPoly", "points": [ [ [ [ -92.53941242522892, 41.51492979593705 …
Otterman
  • 530
  • 2
  • 5
  • 16
0
votes
1 answer

GSON from JSON with numeric class names

I have a JSON string coming from a server, and I have no control over it. I generated the Java classes through programmatic usage of the jsonschema2pojo library. I am using GSON to deserialize the JSON into my Java objects. Here is an example of the…
User51610
  • 453
  • 5
  • 18
0
votes
2 answers

How to turn this JSON response into POJO?

The automated JSON to POJO fails badly with this JSON. Please note that the number of items is different from one request to the other. here I'm including JSON response with 2 items. { "status": 1, "complete": 1, "list": { …
Tlink
  • 875
  • 2
  • 14
  • 30
0
votes
1 answer

Avoid setter method generation via jsonschema2pojo

I want to generate a class via json that does not have setter method for a given property. Is there any option in jsonschema2pojo json schema definition that can help me achieve this?
JavaYouth
  • 1,536
  • 7
  • 21
  • 39
0
votes
2 answers

How can I create a POJO from this sample JSON?

I'm trying to create POJOs for the following JSON from the API at https://developers.google.com/qpx-express/v1/trips/search When I copy & paste this into http://www.jsonschema2pojo.org/ I get an error at line 5 "requestId": string, saying "There's a…
intA
  • 2,513
  • 12
  • 41
  • 66
0
votes
0 answers

jsonSchema2pojo jackson deserialisation issue

I am trying use jsonSchema2pojo POJO generating library and i am successful in doing so as well. But issue i am facing is deserialisation Exception when i try to generate map by typeReferencing generated rootClass i.e EsRootDoc(in below code). Here…
Kimchy
  • 501
  • 8
  • 24
0
votes
0 answers

json schema to pojo error with double quotes

I am trying to convert mentioned part of the JSON response from forecast api to POJO using http://www.jsonschema2pojo.org/. When I try to convert this to pojo the error says There's a problem: Unexpected character ('l' (code 108)): was expecting…
Aalap Patel
  • 2,058
  • 2
  • 17
  • 31
0
votes
1 answer

(useless?) Resource__ classes with jsonschema2pojo

Familiar with Java and XML, I have tried to process JSON data. I'm using jsonschema2pojo to generate Plain Old Java Objects from example JSON data. Let's say I want to import products and categories from a…
Roland Beuker
  • 354
  • 1
  • 15
0
votes
1 answer

Retrofit 2.0 parse dynamic json from same POJO class

What I Have I have a server success response { "response_code": 200, "status": "success", "message": "enqiry chat fetched successfully", "meta_data": { "count": "6" }, "data": { "enquiries": [ ] } } When Error , the same…
karthik kolanji
  • 2,044
  • 5
  • 20
  • 56
0
votes
0 answers

Consume rest service in android which takes complex data type as parameter

[OperationContract] [WebInvoke(UriTemplate = "/CreatePerson", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, Method = "POST")] EMPDetails CreatePerson(EMPDetails createPerson); // Implementation public…
user3012974
  • 43
  • 2
  • 8
0
votes
1 answer

I need help running a unit test for jsonschema2pojo

I have a question regarding unit testing of jsonschema2pojo. What I am trying to do is use the sample unit test in…
Arnout Cator
  • 81
  • 1
  • 1
  • 7
0
votes
0 answers

Json parse to Android

I have used retrofit once to turn parse json into java classes but now I have this json data which is a list of movies and the problem when I use the site jsonschema2pojo it creates classes with movie names but the problem is the movies keep…
user3277530
  • 351
  • 6
  • 14