开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜