Skip to content

Contains not working as expected with array of objects #145

Closed Answered by karenetheridge
alessio-greco asked this question in Q&A
Discussion options

You must be logged in to vote

Because you don't say that "somePropertyA" is required. The first item passes the "contains" constraint because there is no "somePropertyA" to apply the schema to.

add "required": ["somePropertyA"] to your "contains" subschema and things will work as you expect.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by karenetheridge
Comment options

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

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
Converted from issue

This discussion was converted from issue #144 on January 26, 2022 15:50.