Skip to content

How to validate that an array contains only keywords from existing properties? #358

Answered by awwright
ubertrombone asked this question in Q&A
Discussion options

You must be logged in to vote

There is no standardized way to do this, that is because JSON Schema is mostly limited to "structural" validation, rather than "data consistency" validation that depends on remembering values that have been defined elsewhere in the document.

Some more information is available here: https://github.com/json-schema-org/json-schema-spec/wiki/Scope-of-JSON-Schema-Validation

However this may still be possible, as JSON Schema is somewhat extensible. "$data" is one such solution. It will depend on the particular validator you're using.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ubertrombone
Comment options

@Relequestual
Comment options

Answer selected by ubertrombone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants