Syntax for documenting JSON structure

前端 未结 7 1781
别那么骄傲
别那么骄傲 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:56

    How to generate a HTML Documentation from JSON:

    You will need to generate a Json Schema, there is this service that you can paste the orginal JSON and auto generate the Schema:

    http://www.jsonschema.net/

    With the schema in hands you can auto generate the HTML Documentation using Matic.

    https://github.com/mattyod/matic

    Generating HTML

    To Install Matic you will need install Node.js: http://nodejs.org/

    On Windows, run CMD

    Install Jade running this command: npm install -g jade

    Open the Downloaded Matic folder from Github: cd PATH_TO_FOLDER/matic

    Run the install command: npm install -g

    Download a documentation example project: https://github.com/mattyod/matic-simple-example

    Put your schema in the folder "schemas"

    Open the project folder: cd PATH_TO_PROJECT_FOLDER

    Run command: matic

    You should see a success message: Documentation built to ./web/

    0 讨论(0)
提交回复
热议问题