Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generate documentation from schemas #139

Open
bogaert opened this issue Apr 6, 2016 · 8 comments
Open

Auto-generate documentation from schemas #139

bogaert opened this issue Apr 6, 2016 · 8 comments

Comments

@bogaert
Copy link

bogaert commented Apr 6, 2016

A common request: auto-generate documentation from the schemas, because JSON schemas are hard to read and people don't document them.

@chuwy
Copy link
Contributor

chuwy commented Apr 6, 2016

That would lovely! Any concrete examples?

@bogaert
Copy link
Author

bogaert commented Apr 6, 2016

I don't have examples, I'll see whether I can find some.

A first good step might be to present all schemas in a more readable format (a simple table), so people who're not technical can understand what the fields are. An extension might be to allow people to annotate the schema or particular fields (e.g. what is the field supposed to capture?).

@fblundun
Copy link
Contributor

fblundun commented Apr 7, 2016

Maybe a way to generate an example from a JSON schema?

e.g.

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  }
}

would generate

{
  "name": "abc"
}

It may be harder to get this working for more complex schemas... Also, a single example can't tell you everything about the schema. For example, it can't tell you which fields are optional.

@chuwy
Copy link
Contributor

chuwy commented Apr 7, 2016

This is a very interesting idea worth do discover.

I don't think it's worth to generate an instance out of Schema because 1) most of Schemas are generated with Schema Guru, so we have real instances; 2) it is really complicated task, I have a code which generates JSON out of Schema, but most of them contains non-sense values.

Idea with tables is nice. We're flattening Schemas in schema-guru ddl, we can do something similar for documentation purposes. One little problem is that tables are flat, and we inevitable will lost some information trying to represent nested structure.

One other good option I see now is docson, not very shiny UI, but it can be improved. Also I see an arising idea of manual documentation. JSON Schema provides description property. We can provide users of Scala repo ability to annotate their properties (through docson?).

@alexanderdean
Copy link
Member

docson is a great find!

@bogaert
Copy link
Author

bogaert commented Apr 7, 2016

Docson looks good. Longer term, it might indeed make sense to use description.

@dashirov-fl
Copy link

This has been on ice for the past 4 years. Has the feature been abandoned? Is there any reason to expect any traction on the subject any time soon?

@szareiangm
Copy link
Contributor

@dashirov-fl we used this tool and added our schemas to a md website generator: https://github.com/adobe/jsonschema2md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants