Schema validation for mixed array type #2781
Unanswered
supercoffee
asked this question in
Q&A
Replies: 1 comment 2 replies
-
See you |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out the correct way to validate an array that can contain mixed object types while also validating that each of the objects matches a valid schema. I've been able to pull off mixed type validation with single properties, but this array is throwing me off.
Example data. The last element in the array should not pass validation, but the first two should match the
ObjectWithId
andUserWithEmail
schema respectively.Example schema
I've tried all kinds of variations of
items
/anyOf
/oneOf
but nothing generates a schema other thanBeta Was this translation helpful? Give feedback.
All reactions