How to constraint maximum length of keys of an object in JSON schema?
44 views
Skip to first unread message
Ilya Kulakov
unread,
Mar 25, 2016, 3:35:35 PM3/25/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JSON Schema
I would like to constraint maximum length of a key of the property which type is object. All of its values are generated in runtime and I'd like to spot a misbehavior as soon as possible by validating document before further processing.
Austin Wright
unread,
Apr 4, 2016, 5:08:41 AM4/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JSON Schema
I don't know if there's a keyword that will actually accomplish this, but it seems like a reasonable one to include.
There might still be some non-standard way you can specify this as a guideline to your particular JSON Schema validator, though.
Ilya Kulakov
unread,
Apr 4, 2016, 11:13:38 AM4/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JSON Schema
Austin,
I was suggested to use patternProperties with a matter that limits the length.
While this will work, I believe it's not the most efficient approach.
понедельник, 4 апреля 2016 г., 5:08:41 UTC-4 пользователь Austin Wright написал: