-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config option for additionalProperties on false by default #61
Comments
The code to handle Do you mean, when additionalProperties is not specified, this line of code returns a |
Yes, that is indeed the behaviour i would like, since in OAS3 additionalProperties is true by default. And i think this should be configurable, since it is not desirable for everyone that uses the library. I use api response validation in tests based on the swagger definition, and i want my tests to fail if new fields are added (when additionalProperties is false in the definition) or removed(when fields are required in the definition). As an example for the following data structure i would have the following schema in the components section of a doc
If i write in the initializer file something like Then i could simplify the above code like this
|
OK, I'll do this in a few hours. |
Done. Try the latest version 2.1.3. |
Works great. Thanks so much ! |
Hi,
Thanks for writing this library !
Got used to most of the DSLs provided and was wondering if there is a way to configure additionalProperties to be implicitly false on all schemas/subschemas if not specified.
I'd like to be able to either configure it globally in the configuration file or in a schema object and have it applied on all schemas that are nested.
The text was updated successfully, but these errors were encountered: