-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!The bug or enhancement requested in this issue has been checked-in!area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
The problem is that nullable references are created like this:
"NullableOfChocolateChip": {
"type": "integer",
"nullable": true
}
"result": {
"$ref": "#/components/schemas/NullableOfChocolateChip"
}
Describe the solution you'd like
I want OpenAPI references to be created using allOf
so that I can make the reference nullable. For example:
"cookie": {
"allOf": [
{
"$ref": "#/components/schemas/ChocolateChip"
}
],
"nullable": true
}
Additional context
With SwashBuckle, this works by:
// https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2378#issuecomment-1072977332
// https://github.com/OAI/OpenAPI-Specification/issues/1368
options.UseAllOfToExtendReferenceSchemas();
options.SupportNonNullableReferenceTypes();
dfaivre-pcs
Metadata
Metadata
Assignees
Labels
✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!The bug or enhancement requested in this issue has been checked-in!area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi