Merge two JSON Schemata generated from Json document

182 Views Asked by At

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 tools to generate the schema.

The first one - https://www.jsonschema.net/home - generates the schema with lot more information for the attributes like below

"properties": {
"ID": {
    "$id": "#/properties/PayLoad/properties/Task/items/anyOf/0/properties/TaskData/properties/ID",
    "type": "string",
    "title": "The ID schema",
    "description": "An explanation about the purpose of this instance.",
    "default": "",
    "examples": [
        "0ab027cc-1e00-4488-b534-002963fa8bb8"
    ]
},

AND

the second one - https://app.quicktype.io/#l=schema - generates the schema that includes format like

"properties": {
    "ID": {
      "type": "string",
      "format": "uuid"
    },

I would like to merge the two schemata that would include the properties from both. Since the JSON is really big, about 3000 lines, I want to avoid manually merging them.

Is there a way I can do this programmatically in Java? Or is anyone aware of an online tool that generates the schema that includes all the properties?

Thank you

I

0

There are 0 best solutions below