Open
Description
I've been using your serverless-openapi-documenter
and I think the root cause is in here.
When converting something of the form:
"foo": {
"title": "foo",
"type": [
"string",
"null"
]
}
the converted output is
"foo": {
"title": "foo",
"oneOf": [
{
"type": "string"
},
{
"nullable": true
}
]
}
However, I don't think that is valid. (It certainly gives errors when I try to use the generated open api file, e.g. in postman)
I think it needs to be either:
"foo": {
"title": "foo",
"type": "string",
"nullable": true
}
or
"foo": {
"title": "foo",
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
with the former looking slightly neater. Both work correctly when I manually update my generated open api file.
I can see convertNull
in Converter.js
appears to be making the transform, but don't know if it is as easy as just changing its return value.
Metadata
Metadata
Assignees
Labels
No labels