Union types with `anyOf` instead of array
Closed this issue · 3 comments
JulianCataldo commented
Hello :)
It seems like
"type": ["string", "null"]
would be better off with:
{
"anyOf": [
{
"type": "string"
},
{
"type": "null"
},
]
}
As AJV docs specifies: https://ajv.js.org/strict-mode.html#strict-types
Stemming from this issue:
seriousme/fastify-openapi-glue#445 (comment)
Any specific reason for this format (I never encountered it before TBH)?
Thanks for your work.
valentinpalkovic commented
@JulianCataldo Interested in opening a PR? :)
JulianCataldo commented
When I'll go back to the project using it, I'll try to hack the generator internals a bit, to see.
alexandrtovmach commented
@valentinpalkovic please take a look on PR. Added this feature