elnabo / json2object

Type safe Haxe/JSON (de)serializer
MIT License
66 stars 17 forks source link

Incorrect handling of arrays in schemas #45

Closed Gama11 closed 5 years ago

Gama11 commented 5 years ago

I was a bit confused that VSCode was only providing auto-completion for the first element of a arrays with a json2object-generated schema. Turns out that instead of generating this:

"items": [
    {
        "$ref": "#/definitions/foo"
    }
]

It should be generating this:

"items": {
    "$ref": "#/definitions/foo"
}

Otherwise the $ref only applies to the first array element.