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

Merge two JSON Schemata generated from Json document

I have a huge JSON and am trying to generate a schema for it that I could use with schema2pojo plugin to generate java classes. I have used these 2 - 1. https://www.jsonschema.net/home AND 2. https://app.quicktype.io/#l=schema online…
adbdkb
  • 1,897
  • 6
  • 37
  • 66
0
votes
1 answer

Android store nested JSON Objects from Api call to Sqlite

How do I store Object that have other Objects as Instance Variable in an android SQLite database. Basically, I have my JSON response from Rest Api call to look like: { "announcements": [ { "courseId": "196014605914", "id":…
Mab
  • 412
  • 3
  • 12
0
votes
1 answer

Embedded Kafka test cases are error after adding jsonschema2pojo-core

I have an application that created with Spring boot and Spring kafka libraries. Now I added jsonschema2pojo-core library to my pom file. After adding this jar file my test cases are failing with below error Caused by:…
VKR
  • 195
  • 4
  • 18
0
votes
1 answer

JSON to Pojo Converter Online jsonschema2pojo

I am using this site since last one year. I have done some kind of configuration on google Chorme(in my last system). It was working well in my previous system. but this Site is not working without that configuration in my others system. Please…
Nadim Ansari
  • 574
  • 5
  • 20
0
votes
1 answer

Is there a way to deserialize and serialize a field in a different way by using jsonschemapojo2?

Let's assume I have the following pojo class pojo{ String color; } I want to deserialize color like so: { COLOR: "red" } and serialize color like so: { color: "red" }
Fernando
  • 381
  • 1
  • 5
  • 20
0
votes
1 answer

using jsonschema2pojo only creates List, nothing more complex
I'm trying to use jsonschema2pojo to generate java objects, but my array of objects is just producing a List not a new, mapped object. Is there a config setting I need to provide? In the below example, I was expecting an OtherLanguages…
end-user
  • 2,845
  • 6
  • 30
  • 56
0
votes
0 answers

System for data validation and class generation (Avro vs Json Schema vs OpenAPI)

We want to have a system that allows us to define data schemas that we can use to validate our data, and to generate code in specific languages. We found json schema's that lets us do something like File "message.json.schema" { "$schema":…
user246100
  • 670
  • 1
  • 11
  • 20
0
votes
0 answers

JSON Schema property's properties depend on the value of another property

Trying to create a schema of the below JSON. { "peopleNames": [ { "name": "John Doe", "Address": "10th Street, Chicago, WI", "jobInformation": { "employers": [ "ABC", "ChocolateFactory" ] …
0
votes
1 answer

Unrecognized field exception due to Incorrectly formatted O/P of objectMapper.writeValueAsString

I am trying to deserialize my hashmap(JSON) to POJO class using Jackson - ObjectMapper . Below is the hashmap : List setJSONValues = new ArrayList(Arrays.asList(requestObj)); List setJSONKeys = apiUtility.readJSONKeys(new …
Mandy
  • 433
  • 2
  • 8
  • 25
0
votes
0 answers

jsonschema2pojo to accept single string into an array of strings variable

I am generating POJO using jsonschema2pojo plugin. This object has 100 variables where for only few variables which are of type array of String, I would like to accept simple string values as well. Current schema for one such attribute is given…
0
votes
1 answer

Populating large set of parameters with Setter methods

I am using POJO to create and fetch data. These POJOs represent our APIs and we use them for testing through REST Assured. I have a RequestDTO class with 30 variables. Since this is a DTO, I am using 30 setter methods in my class for updating there…
Mandy
  • 433
  • 2
  • 8
  • 25
0
votes
1 answer

Convert json schema to kotlin data class dynamically

I have a json schema in draft 04 format (http://json-schema.org/draft-04/schema#) which is used to define a configuration. These schemas are dynamically created based on use input. I need to pass this json schema to a method which only accepts a…
Pranay Kumar
  • 400
  • 1
  • 3
  • 12
0
votes
1 answer

How can we generate Java 8 Optional getters using jsonschema2pojo

Generating java Pojo classes using gradle plugin jsonschema2pojo but i need to generate java8 optonal getter method Example.json { "type":"object", "properties": { "foo": { "type": "string" }, } } Generating getter method like…
G SriHAri
  • 706
  • 2
  • 9
  • 27
0
votes
0 answers

how can control dynamic retrofit2 response object

i have 2 endpoints give me Category detail. one is like below just give a list of category children: [{ "id": 5, "title": "cat1", "parent": 1 }, { "id": 4, "title": "cat2", "parent": 1 }, { "id": 2, "title": "cat3", …
0
votes
1 answer

How to implement Parcelable for double ArrayList?

I got a JSON with an array of doubles and another for Strings. I am trying to create a Parcelable model class with the relevant methods. When the methods are created automaticaly, no line for the doubles' array list is created. I looked for relevant…
D. Joe
  • 81
  • 10