How to disable AdditionalProperties being generated in Swagger #7975
Replies: 2 comments
-
I had the same problem with using the .NET 6 Swashbuckle package and solved it by creating a custom schema filter that disabled additional properties. From research, I found out that since some version of swagger AdditionalProperties is set globally to True instead of False for some reason. Here is my schema filter implementation
and here how to use it with swagger in .NET 6
I hope this will at least help point you in the right direction |
Beta Was this translation helpful? Give feedback.
-
Note that |
Beta Was this translation helpful? Give feedback.
-
Hi, We are using RestEasy to build our rest services and swagger annotations for documentation. We are upgrading from a very old version of swagger UI 2.x to 4.10.3. Seeing below in few object responses, which were not showing before, Is there any way to disable them being generated.
{
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}
Beta Was this translation helpful? Give feedback.
All reactions