Types used in Array Not Generating

9 views
Skip to first unread message

Larry Fuqua

unread,
Apr 14, 2017, 12:40:39 PM4/14/17
to jsonschema2pojo-users
I'm having a problem getting types to generate that are used as polymorphic types under an array element.

I have a schema with an element setup as:

    "things": {

      "type": "array",

      "items": {

        "$ref": "definitions.json#/definitions/thing"

      }

    },


The thing is defined within the definitions schema as: 

    "thing": {

      "oneOf": [

        {

          "$ref": "#/definitions/thing_one"

        },

        {

          "$ref": "#/definitions/thing_two"

        },

        ... (a bunch more)

      ]

    },


No types for the various oneof references are being generated.  

Each of those follows a similar pattern of:

    "thing_one": {

      "title": "Thing One",

      "allOf": [

        {

          "$ref": "#/definitions/thing_base"

        },

        ... (other stuff)

      ]

    },


Where thing_base is:

    "thing_base": {

      "type": "object",

      "required": [

        "id",

        "type"

      ],

      "properties": {

        "id": {

          "type": "string"

        },

        "type": {

          "type": "string"

        },

        ... (other stuff)

      }

    },


Is there something missing? Is there somewhere I can find a working example using an array of various types based off a base type?
Reply all
Reply to author
Forward
0 new messages