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
1
vote
1 answer

How to check additional values with if condition (using karate framework)?

I would like to check response from GET/birds request with a json schema. In my feature: * def abs = read (birds.json) * match response == abs.birdsSchema I need to put the schema in a json file and not in the feature. I have to check additional…
cygne
  • 527
  • 1
  • 10
  • 28
1
vote
1 answer

jsonschema2pojo gradle plugin not generate Java classes in subproject

I have React Native Android project with jsonschema2pojo Gradle plugin in root project and in subproject too (located in cd ../node_modules/subproject) with different jsonSchema2Pojo configuration dependencies { compile…
sytolk
  • 7,223
  • 3
  • 25
  • 38
1
vote
1 answer

How to get nested class instance drools

I am newbie to drool usage and i have small query. I have map as below for which i have created pojo using schemaJson2Pojo java api : { "svo": [ { "clause": "Sunanda Pushkar died of poisoning", "svoMetadata": { …
Kimchy
  • 501
  • 8
  • 24
1
vote
4 answers

Check JSON object in java

I am fetching a JSON using retrofit 2, which carries object if the key has value else an empty array. ex: If the key i.e address has values it returns object { "student": { "name": "Some name", "address": { "house":…
Imtiaz Hossain
  • 347
  • 5
  • 16
1
vote
0 answers

JSON Schema references with $ref

I have multiple schema definitions in multiple files (multiple .json files), Does JSON schema allow schema definition in multiple .json files in multiple directories ? Or should all schema definitions (all *.json files) reside in one directory…
josh
  • 13,793
  • 12
  • 49
  • 58
1
vote
1 answer

jsonschema2pojo duplicate classes (not duplicate class names)

Jsonschema2pojo is behaving correctly. However I would like to change its behavior. After I run Jsonschema2pojo I end up with my top level classes (14 of them) and 14 member classes. The member classes look like "WatchSpecs.java", …
GOOGGOOG
  • 11
  • 3
1
vote
2 answers

how to create a pojo class with dynamic key for arrayname

I am working with Rxandroid and retrofit. I have a json with dynamically changing array name like this, { "2016-10-02": [ { "name": "foo", "id": "1", "category": "bar" }, { "name": "foo", "id": "2", …
Suresh Basnet
  • 147
  • 2
  • 13
1
vote
1 answer

declare java.util.Map into json-schema

I need to map a java.util.Map instance into a JSON-schema that is used by org.jsonschema2pojo maven plugin to create a POJO. I didn't find a good and simple solution for this. Could someone help me please? This is my actual json-schema file { …
Fabrizio P
  • 241
  • 3
  • 13
1
vote
1 answer

Jackson Unrecognized field "media:recent"

I'm having problems deserializing JSON into my POJO object. This is a snippet of my JSON ....."_embedded": { "media:recent": { "_links": { "self": { "href": "//url" } } } },.... And here is my Class …
1
vote
2 answers

Retrofit 2 with Proguard

Without Proguard enabled, retrofit2 work properly... but when enabled, application crash... Here is my Proguard rules: -dontwarn retrofit2.Platform$Java8 -dontwarn okio.** -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes…
Ucdemir
  • 2,852
  • 2
  • 26
  • 44
1
vote
1 answer

How to use dynamic json value on my POJO class with Gson?

{ "localeCode": "", "map": { "DynamicName1": [], "DynamicName2": [ { "date": "2016-05-15T00:00:00", "seqId": 1, "status": 10 }, { "date": "2016-05-16T00:00:00", …
Azizi Musa
  • 1,009
  • 2
  • 10
  • 31
1
vote
3 answers

JSON Schema to POJO - Enum as a separate java file

Type.json (Enum) { "type" : "string", "$schema" : "http://json-schema.org/draft-04/schema#", "title": "type resource", "name": "type resource", "description": "List of types", "id" : "type:v1", "enum" : [ …
user104309
  • 690
  • 9
  • 20
1
vote
2 answers

Moving from AsyncTask to Retrofit

I am using Asycntask for handling my service. However, I want to use Retrofit and like to get some advice before moving on. My json services are like following. All of them have a result JSONObject and data(JSONObject or JSONArray). When I look at…
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
1
vote
1 answer

How to enforce restrictions in Json Schema

we are using JsonSchema to document our Rest APIs and I need to be sure that every string, number, array has restrictions on their maximum size applied to them i.e. all strings have a maxLength & pattern set all integers/numbers have a maximum…
MandyW
  • 1,117
  • 3
  • 14
  • 23
1
vote
1 answer

Unable to generate Java classes from JSON Schema using JsonSchema2Pojo-maven-plugin

I have used the following URL to understand the usage of JsonSchema2Pojo plugin https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started#the-maven-plugin However, I am unable to generate any class for the address schema. I have followed…
chetan sharma
  • 121
  • 2
  • 8