Syntax for documenting JSON structure

前端 未结 7 1786
别那么骄傲
别那么骄傲 2021-01-31 01:14

So I\'m trying to document the format of the json returned by an api I am writing against and I\'d like to know if there is any popular format for the documentation of json stru

7条回答
  •  一整个雨季
    2021-01-31 01:38

    In theory JSON Schema could serve this purpose, but in practice I am not sure it does. Worth mentioning I hope.

    Other than this, my personal opinion is that since JSON is predominantly used for transferring objects, documenting equivalent objects in language client uses (Java, C#, various scripting languages) may make most sense -- after all, such objects usually are mapped/bound to JSON and back. And then you can use whatever documentation tools are available, like Javadoc for Java (perldoc for Perl, Oxygen for c++ etc etc).

    For specifying interfaces there is also WADL (Web App Description Language), which might help.

提交回复
热议问题