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
I want my server to reject requests where the body includes unknown properties. In json-schema I would typically do this with additional-properties=false. However according to https://goswagger.io/use/models/schemas.html go-swagger's model will simply strip such additional properties out instead of rejecting the request.
Is there anyway to instruct the generated code to fail validation if additional properties are detected, instead of ignoring them?
The text was updated successfully, but these errors were encountered:
@Marclev78 You can try to generate your server with the --strict-additional-properties flag.
There are some corner cases with that option, but it should basically cover what you want.
Problem statement
I want my server to reject requests where the body includes unknown properties. In json-schema I would typically do this with
additional-properties=false
. However according to https://goswagger.io/use/models/schemas.html go-swagger's model will simply strip such additional properties out instead of rejecting the request.Is there anyway to instruct the generated code to fail validation if additional properties are detected, instead of ignoring them?
The text was updated successfully, but these errors were encountered: