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

Set mode to handle readOnly and writeOnly #909

Closed
kromol opened this issue Dec 17, 2018 · 1 comment
Closed

Set mode to handle readOnly and writeOnly #909

kromol opened this issue Dec 17, 2018 · 1 comment
Labels

Comments

@kromol
Copy link

kromol commented Dec 17, 2018

What version of Ajv you are you using?
6.6.2

What problem do you want to solve?
I want to use the same schema for request and response by leveraging readOnlyand writeOnly properties.

What do you think is the correct solution to problem?
One possible solution would be to add new configuration option mode that would set Ajv mode to either DEFAULT (like it works now) or READ(in this mode all readOnly items should be taken into account) or WRITE(should validate writeOnly stuff)

Will you be able to implement it?
Probably

@epoberezkin
Copy link
Member

It is much easier to do with schema pre-processing step outside of ajv, when a single schema is used to construct READ, WRITE and DEFAULT schema.

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

No branches or pull requests

2 participants