Skip to content

[FEATURE] Support for OpenApi 3.1 nullable #833

@frederikstonge

Description

@frederikstonge

I migrated my dotnet backend from .NET 8 with Swashbuckle to .NET 10 with Microsoft.AspNetCore.OpenApi.

Some pieces of my schema were referenced as allOf (no idea why) with a nullable attribute.

"advancedSettings": {
  "allOf": [
    {
      "$ref": "#/components/schemas/AdvancedSettings"
    }
  ],
  "nullable": true
},

And now, they generate like this :

"advancedSettings": {
  "oneOf": [
    {
      "type": "null"
    },
    {
      "$ref": "#/components/schemas/AdvancedSettings"
    }
  ]
},

Any idea if there's a way to support oneOf with just type null and the ref without discriminator?

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions