开发者

JSON documentation standard? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

开发者_开发技巧 Improve this question

Is there a recognized, recommended, or standard form for representing the structure of JSON? E.g., my service returns a structure, effectively, represented as JSON. How do I describe what my service returns, such that another service can consume that JSON and program to its interface?


JSON is a very free-form format. If you'd like to read the specifics, see json.org. If you follow that, anyone who says they can parse JSON will be able to create an object from it.

To tell another service that you are returning JSON, you will want to send a HTTP Response header for content-type: Content-Type: application/json


In addition to what @Chacha102 wrote, while there is not an official schema format for JSON, there is a working draft, as well as other related resources. While you mentioned that validation is not your primary goal, these pointers could still be potentially useful depending on how formal you want to be in communicating your JSON interface.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜