1

I have a json schema that has nested references in the "definitions" property. What I mean is that I have one property defined say "PropertyA" then a second property is defined called "PropertyB" which references "PropertyA"

When I use the preview button on https://www.jsonschema2pojo.org/ then I get the error Path not present: definitions.

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Inbox Item Datalake DTO",
    "definitions": {
        "PropertyA": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string"
                }
            }
        },
        "PropertyB": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/PropertyA"
                    },
                    "default": []
                }
            }
        }
    },
    "properties": {
        "FinalProperty": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/PropertyB"
            },
            "default": []
        }
    }
}

I saw a few posts online about using an absolute path but this is in the exact same file and I didn't see anything about that so any help would be appreciated.

capa_matrix
  • 115
  • 3
  • 10

0 Answers0