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
0 answers

json to pojo wrong mapping with array

I am having a problem when I want to be able to map a single Object but also an Array of those object with com.fasterxml.jackson.annotation Please see below example keep in mind that this is a response payload and it is not under my…
Jimmy Geers
  • 670
  • 1
  • 13
  • 31
0
votes
1 answer

Jsonschema2pojo error with creating a list of objects with class name as "S"

I am trying to generate POJOs from a json schema. Problem : If I have the class name as "s", it throws an error. Error from plugin execution: Execution goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.0:generate failed: String index out…
niharika_neo
  • 8,441
  • 1
  • 19
  • 31
-1
votes
1 answer

JSON to POJO not working when same key is repeated in array

I have below json { "startDate": "2021-02-01", "endDate": "2021-02-14", "columns": [ { "attribute": "PID" }, { "attribute": "CID" }, { "attribute": "SID" …
Johny
  • 49
  • 6
-1
votes
1 answer

Plugin jsonschema2pojo: Properties are shown as required but they should be optional

i have a personschema which has e.g. those two fields: "name": { "title": "Last name", "type": "string", "minLength": 1, "isRequired" : true } "birthday": { "title": "Date of birth", "$ref":…
Katharina
  • 1
  • 1
-1
votes
1 answer

Retrofit: trouble parsing json

After doing some tutorials iam trying to use a specific API but my POJO always get null object, what is the correct way to parse the data inside "results" key? "success": true, "metadata": { "sort": "POPULARITY", "total_products": 20, …
vpedro72
  • 13
  • 7
-1
votes
3 answers

app crashes when passing object via intent

I have a RecyclerView and onclicking any item I want to start an activity by sending the object corresponding to the item via intent. But app crashes when i try to send the object. My Model class public class ProductListDataModel…
visakh r
  • 175
  • 1
  • 11
-1
votes
1 answer

Preserve case while using JSON2POJO maven latest version

I have some JSON as below { "FName": "Test", "LName": "Test" } When i use json2pojo maven plugin(0.4.37), the POJOs are created with the proper Java naming conventions(like fName,lName). Is there a way to override this and create the POJOs…
Jack
  • 1
-1
votes
3 answers

android retrofit 2 response getting trouble

I am new to Retrofit 2.0 i have 1 Ws in to that i am getting this response i have make pojo for this using http://www.jsonschema2pojo.org/ but i am not able to get qid and id. though i am getting que and ans both but not id of both what can the…
Android
  • 8,995
  • 9
  • 67
  • 108
-3
votes
1 answer

Control the getter/setter method names for properties of type object

For the below json, the jsonschema2pojo utility/plugin generates the getter-setter methods by suffixing JavaName of object in user.json with 'get'/'set' respectively. Example: if the 'JavaName' in user.json is User, then getter/setter for property…
JavaYouth
  • 1,536
  • 7
  • 21
  • 39
1 2 3
11
12