Validating a value based on the properties of another object #581
Replies: 2 comments 3 replies
-
Hi. Unfortunately, matching against object keys the way you want isn't possible. There's a lot of ways to get values using my data vocab, but not keys. The problem is that there isn't a good way to query for keys. I think you're going to need to verify this in code. |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for the quick answer. Do you think it would be possible in the future (of json schema) to have access to the keys, so my example can be validated? I think it may help validate more models. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've been searching for this answer for 2 days, even asked chatGPT but nothing seems to work.
I have this json example file:
I need a schema that will validate that the string value for the
uid
property is one of the properties ofuids
.In this example, it will fail since
c
isn't any property ofuids
(in this example, onlya
orb
would be valid). This is of course a dynamic validation.GPT offered me many things (including
$data
,dependencies
) but nothing validated when testing at https://json-everything.net/json-schema/Is it even possible (I don't mind using draft 2020-12), and if yes, how?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions