joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
http://www.jsonschema2pojo.org
Apache License 2.0
6.24k stars 1.66k forks source link

Add $Id Management in the generator. With it, it is possible to #1632

Open martineaus83 opened 2 months ago

martineaus83 commented 2 months ago

reference ($ref) other Schemas by it's $id like Dialect 2020-12 declares it. Samples is provided in jsonschema2pojo-integration-tests project in src/test/resources/json/examples_$id

Other example bellow:

{
    "$id": "http://test.jsonschema2pojo.org/schema-json-test/main-data",
    "title": "main-data",
    "description": "Describe An Object.",
    "type": "object",
    "properties": {
        "DataFirst1": {
            "description": "Reference to http://test.jsonschema2pojo.org/schema-json-test/data-first",
            "type": "array",
            "items": { "$ref": "http://test.jsonschema2pojo.org/schema-json-test/data-first" },
            "uniqueItems": true
        }
    }
}