-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Labels
status:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to closetype:questionAn issue that's a questionAn issue that's a question
Description
ASP.NET Core 10 OpenApi generates "oneOf" schemas for nullable references for OpenApi 3.1 which is structurely different than what would be idiomatic in OpenAPI 3.0
OpenAPI 3.1
"contact":
{
"oneOf":
[
{
"type": "null"
},
{
"$ref": "#/components/schemas/Person"
}
]
}When downcasting this to OpenAPI 3.0 we get
"contact":
{
"oneOf":
[
{
"nullable": true
},
{
"$ref": "#/components/schemas/Person"
}
]
}This is incorrect as { "nullable": true } does not refer to a base schema.
The pattern of "oneOf" with OpenAPI 3.1 should be downcasted to the following:
"contact":
{
"allOf":
{
"$ref": "#/components/schemas/Person"
},
"nullable": true
}Remarks:
- Probably a pattern of "anyOf" with a
{ "type": "null" }should also be recognized. - OpenAPI 3.1 "oneOf" with multiple schemas AND a null schema would be required to be downcasted to a "oneOf" without the
{ "type": "null" }and thenullable: true
Metadata
Metadata
Assignees
Labels
status:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to closetype:questionAn issue that's a questionAn issue that's a question