Validate a subset of the schema? #942
Answered
by
gazpachoking
synchronizing
asked this question in
Q&A
-
I was wondering if it's possible to validate a subset of the schema? That is, say the we have the following schema: {
"type": "object",
"properties": {
"database": {
"type": "object",
"properties": {
"username": {"type": "string"},
"password": {"type": "string"}
},
"required": ["username", "password"]
},
"brands": {"type": "array"},
"version": {"type": "number"}
},
"required": ["database", "brands", "version"]
} And I would like to check only {
"database": {
"username": "local_username",
},
} Is this possible? I looked through the documentation, issues, and discussions, but did not find anything. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
gazpachoking
May 6, 2022
Replies: 1 comment 2 replies
-
You could run the validation, but then ignore any validation errors coming from the 'required' keyword. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
synchronizing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could run the validation, but then ignore any validation errors coming from the 'required' keyword.