Closed drevisios closed 2 years ago
Hi, @drevisios
thank you for the contribution
may I ask in which version of spec this is allowed?
I mean.. oneOf: [ { title: "", description: "", ... }]
Are you sure this is aligned with spec?
Hi @andyglow
I think it is aligned. If we check the draft-07 schema the definition is
"oneOf": { "$ref": "#/definitions/schemaArray" }
and then
"schemaArray": { "type": "array", "minItems": 1, "items": { "$ref": "#" } },
where schema array is a non empty list of schemas, so I guess it should carry all the extra properties.
Still I could be wrong but I find it really useful in my project when I generate forms from the json schema and the field is a union of types. It is useful to have some extra info about these types in a structured way.
closing it without merge in favor of #233 @drevisios please check
@andyglow Perfect!
When generating
oneOf
schema for sum types inside companion object, also include title and description provided from annotations to the subtypes