You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explicit additionalProperties: false should be emitted in OpenAPI 3.1 when AdditionalPropertiesAllowed = false #2646
Is your feature request related to a problem? Please describe.
Currently, when serializing OpenAPI 3.1 documents, setting AdditionalPropertiesAllowed = false on a schema does not emit "additionalProperties": false.
This causes a semantic issue in OpenAPI 3.1 because schemas follow JSON Schema 2020-12, where:
Omitting additionalProperties defaults to an empty schema ({}), which allows any additional properties.
Only explicitly setting "additionalProperties": false prevents extra properties, matching the user's intent.
Currently, OpenAPI.NET only emits additionalProperties: false for OpenAPI 3.0 documents, as demonstrated in #2631 and related tests. While this behavior is intentional per #2630, it does not preserve the explicit intent when targeting OpenAPI 3.1.
Explicitly emittion "additionalProperties": false would align the serializer with the official OpenAPI 3.1 spec and JSON Schema 2020-12 behavior, avoiding silent loss of user intent.
Activity
baywet commentedon Dec 17, 2025
Hi Niels van Dijk (@codijk)
Thank you for using the SDK and for reaching out.
I think you're correct here and we're missing a test case. When the ...Allowed property is set to false and serializing to v3.1/3.2
Is this something you'd like to submit a pull request for provided some guidance?
Start from and target support/v2 and then I'll be able to roll it out to v3.
codijk commentedon Dec 18, 2025
Hi Vincent Biret (@baywet)
Sure, I can submit a pull request for this. I will start from and target
support/v2as you described.