field required if otherfield value is....

3 views
Skip to first unread message

Cari Davidson

unread,
Nov 18, 2009, 1:19:30 AM11/18/09
to json-...@googlegroups.com
Hi JSONistas,

First, I'd like to say thank you for the json-schema. Using this as
a standard, I've taken about 1000 lines of really ugly code and made a
tool that validates multiple versions of an API and transforms the
result into the version of the API that the client expects to see.

There is one thing that I haven't been able to find, however: a way
to require a field if another field has a specific value. There is
the "requires" attribute, but it only accepts the name of the other
field.

Anyone know if this is possible with the current schema proposal, and
if this is the kind of thing that might be useful in a schema
definition?

Thanks for your help.
-- CD
Reply all
Reply to author
Forward
0 new messages