Skip to content
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

additionalProperties configuration #13

Open
saggiyogesh opened this issue Oct 27, 2018 · 3 comments
Open

additionalProperties configuration #13

saggiyogesh opened this issue Oct 27, 2018 · 3 comments

Comments

@saggiyogesh
Copy link

Hi, didn't find any docs / example related to additionalProperties. By default, MongoDB keeps this as true.

How can make it additionalProperties: false globally, so that child objects are also validated.
Is this possible

@DScheglov
Copy link
Owner

Hi, I will add support for strict-option of mongoose-schema (https://mongoosejs.com/docs/guide.html#strict)

In case when strict equals "throw" the json schema will get additionalProperties: false (the same behavior will be repeated for all nested mongoose schemas, but it could be overrided in the nested schema).

It is also possible that the global flag could be added to define default behavior).

@saggiyogesh
Copy link
Author

Hi.
Thanks for considering it.
For time being I've forked the repo & implemented this.

@abarriel
Copy link

up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants