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
"Additional properties false" added to every object in schema in UI when switching to OpenAPI 3.1 #2619
Expected behavior
Additional properties false property not part of schema in UI
Actual behavior
Additional properties false property part of schema in UI
Additional context
Pasting provided sample swagger.json file into (I believe) official generator yields exact same behavior. ( Changing version to "openapi": "3.0.6" hides Additional proerties forbidden field).
Is there any way to prevent "additionalProperties": false from being added to generated swagger.json?
Or is that the correct and expected behavior?
Activity
ntark commentedon Nov 19, 2025
I looked through related code and it seems change (if any) should be made here:
OpenAPI.NET/src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Lines 474 to 484 in f9a6796
commenting line 483 fixes my issue.
I believe there should be ability of passing / configuring a parameter so that writing of
OpenApiConstants.AdditionalPropertiescan be skipped.ntark commentedon Nov 22, 2025
It seems doing that removes
additionalPropertiesproperty from generated document:Produces:
Can devs please comment on that solution?
baywet commentedon Dec 8, 2025
Hi ntark
Thank you for using the SDK and for reaching out.
Thank you for your patience.
I have authored the following PRs to address the issue:
Let us know if you have any additional comments or questions.