开发者

Is there a standard way to describe the data in JSON format, similar to a WSDL file for SOAP?

开发者 https://www.devze.com 2023-02-22 20:45 出处:网络
Basically, I want to be able to say that few fields have extra restrictions beyond \"string\" and \"integer\".For example, field \"u开发者_Python百科ser name\" is 32 characters or less, \"age\" must b

Basically, I want to be able to say that few fields have extra restrictions beyond "string" and "integer". For example, field "u开发者_Python百科ser name" is 32 characters or less, "age" must be an integer greater than 21, etc.

Is there some standard way to specify this without the huge overhead of a WSDL file, preferably supported by a ruby gem of some sort?


There's the jsonschema gem https://github.com/Constellation/ruby-jsonchema

more info http://json-schema.org/

0

精彩评论

暂无评论...
验证码 换一张
取 消