Skip to content

Validate a schema file: Find typos in property names #380

Answered by jdesrosiers
cweiske asked this question in Q&A
Discussion options

You must be logged in to vote

In JSON Schema 2020-12 (and all versions that came before it), it's allowed for users to add their own custom keywords. The meta-schema isn't capable of being smart enough to know that requireds is a typo and not a custom keyword that you chose to include in your schema.

IMO, what's really needed for something like this is a linter that is smart enough to notice that requireds looks a whole lot like the known keyword required and give you a warning that it's probably a typo. Unfortunately, a linter capable of checking for those sorts of errors doesn't exist. There's been talk about it for years, but no one has managed to find the time to build it.

That said, there's an easy workaround you…

Replies: 2 comments 3 replies

Comment options

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

@Relequestual
Comment options

Comment options

You must be logged in to vote
1 reply
@cweiske
Comment options

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