Skip to content

Emit x-nullable for required nullable properties in Swagger2 - #1931

Open
raeffs wants to merge 1 commit into
RicoSuter:masterfrom
raeffs:fix/1930-swagger2-required-nullable-xnullable
Open

Emit x-nullable for required nullable properties in Swagger2#1931
raeffs wants to merge 1 commit into
RicoSuter:masterfrom
raeffs:fix/1930-swagger2-required-nullable-xnullable

Conversation

@raeffs

@raeffs raeffs commented Jul 23, 2026

Copy link
Copy Markdown

When a nullable property ends up in the Swagger2 required array, emit x-nullable: true.
This mirrors the OpenApi3 behaviour and matches runtime semantics:
These markers require the property to be present but still allow a null value.

Fixes #1930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swagger2: C# required keyword on a nullable property silently drops its nullability (11.6.1 fix ineffective for SchemaType.Swagger2)

1 participant