Skip to content

Order of pattern properties matter! #619

Answered by Julian
girish-tharwani asked this question in Q&A
Discussion options

You must be logged in to vote

In your simplified example that should be pretty easy, just use additionalProperties instead, i.e.:

{
    "patternProperties": {
        "^[Bb][Aa][Rr]$": {
            "type": "string"
        }
    },
    "additionalProperties": {
        "type": "number"
    }
}

If that doesn't work for your real example you'll probably need to expand your simplified one, but hopefully that helps.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@girish-tharwani
Comment options

@Julian
Comment options

Answer selected by girish-tharwani
@Julian
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants