3 ms·
We could just write a JSON Schema for it. It allows you to specify a "format": http://json-schema.org/latest/json-schema-validation.html#anchor104 http://json-
by tiglionabbit 10y ago
We could just write a JSON Schema for it. It allows you to specify a "format": http://json-schema.org/latest/json-schema-validation.html#anchor104 http://json-schema.org/latest/json-schema-validation.html#an...
So you can write a schema like: {"type": "string", "format": "email"}
or: {"type": "integer", "format": "uint64"}
There's no spec for what is allowed as a "format", so you have to decide on your own values and write your own validators, but someone could come up with a standard spec for this. Swagger formally specifies some values of "format" in this document: http://swagger.io/specification/ http://swagger.io/specification/