{"id":13553793,"url":"https://github.com/lbovet/docson","last_synced_at":"2025-05-16T02:10:18.004Z","repository":{"id":12279525,"uuid":"14903365","full_name":"lbovet/docson","owner":"lbovet","description":"Documentation for your JSON types","archived":false,"fork":false,"pushed_at":"2023-11-05T00:43:36.000Z","size":1463,"stargazers_count":496,"open_issues_count":44,"forks_count":93,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-08T13:15:15.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lbovet.png","metadata":{"files":{"readme":"README.md","changelog":"Changes.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-12-03T19:23:37.000Z","updated_at":"2025-05-06T14:21:58.000Z","dependencies_parsed_at":"2024-01-03T05:44:16.247Z","dependency_job_id":"ab24945c-009f-4aef-9de7-ef7cf28a6d14","html_url":"https://github.com/lbovet/docson","commit_stats":{"total_commits":137,"total_committers":18,"mean_commits":7.611111111111111,"dds":0.4963503649635036,"last_synced_commit":"70649ed5b35901c25420bf9bf52285c151f148b7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbovet%2Fdocson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbovet%2Fdocson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbovet%2Fdocson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbovet%2Fdocson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbovet","download_url":"https://codeload.github.com/lbovet/docson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:02:33.450Z","updated_at":"2025-05-16T02:10:17.982Z","avatar_url":"https://github.com/lbovet.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others","JSON Schema Tools"],"sub_categories":[],"readme":"\u003cp align='right'\u003eA \u003ca href=\"http://www.swisspush.org\"\u003eswisspush\u003c/a\u003e project \u003ca href=\"http://www.swisspush.org\" border=0\u003e\u003cimg align=\"top\"  src='https://1.gravatar.com/avatar/cf7292487846085732baf808def5685a?s=32'\u003e\u003c/a\u003e\u003c/p\u003e\n\nDocson\n======\n\nDocumentation for your JSON types.\n\nGive Docson a JSON schema and it will generate a [beautiful documentation](http://lbovet.github.io/docson/index.html#/docson/examples/example.json).\n\n## Features\n* [JSON schema](http://json-schema.org/) v4 keywords.\n* Runs entirely in the browser.\n* Render schema descriptions with markdown\n\n## Installation\n\n* Place the Docson distribution on the web server serving the schemas (to avoid cross-origin issues).\n* If you want to use Docson without a web server, you may be interested in the [Offline Usage Tutorial](https://gist.github.com/riegl-aw/6b258499887fc3e302f0b5dbcfa7b3d9).\n\n## Usage\n\n### Via cli tool\n\n    $ docson -d ./schemas/\n    server ready and running at localhost:3000\n\n    # and then...\n    firefox http://localhost:3000/schemas/ship.json\n\n### As a webpage widget\n\nTo include a Docson schema documentations on any page (wiki, ...) without worrying about messing up with javascript libraries and cross-origin issues:\n\n* Install Docson somewhere as described above.\n* Place the following `script` tags in the including page, nothing else is needed:\n\n    \u003cscript src=\"http://somewhere/path-to-docson/public/js/widget.js\" data-schema=\"/path-to/schema.json\"\u003e\n    \u003c/script\u003e\n\n\n### Add to a webpage\n\n* Open [index.html](http://lbovet.github.io/docson/index.html) and enter the schema path in the form field.\n* Or give the schema path directly as hash parameter: [index.html#/docson/examples/example.json](http://lbovet.github.io/docson/index.html#/docson/examples/example.json)\n\nNote that you can refer to a sub-schema by adding a json-pointer path as 'dollar-parameter': [index.html#/docson/examples/example.json$items](http://lbovet.github.io/docson/index.html#/docson/examples/example.json$items)\n\n## Typson\n\nYou can directly reference your JSON types defined as TypeScript interfaces. If the path ends with `.ts`, Docson will use [Typson](https://github.com/lbovet/typson) to convert the Type Scripts to schema in order to generate the documentation.\n\nFor example, [index.html#/typson/example/invoice/line.ts$InvoiceLine](http://lbovet.github.io/docson/index.html#/typson/example/invoice/line.ts$InvoiceLine) is the documentation of [line.ts](https://github.com/lbovet/typson/blob/master/example/invoice/line.ts).\n\nYou need to install [Typson](https://github.com/lbovet/typson) by yourself on your server. It must be in a directory named `typson` located at the same level as the `docson` directory.\n\n\n## Swagger\n\nYou can adapt [Swagger UI](https://github.com/wordnik/swagger-ui) to display Docson-generated model documentation instead of the builtin signatures.\n\nSee how it looks like in the [Swagger Docson example](http://lbovet.github.io/swagger-ui/dist/index.html)\n\nIn Swagger UI's `index.html`, include the [Swagger integration script after other script tags](https://github.com/lbovet/swagger-ui/blob/3f37722b03db6c48cc2a8460df26dda5f4d6f8e4/src/main/html/index.html#L19):\n\n```html\n  \u003cscript src='/path-to-docson/docson-swagger.js' type='text/javascript'\u003e\u003c/script\u003e\n```\n\nAlso, you will need a patched version of [Swagger Client](https://github.com/lbovet/swagger-js/blob/models-exposed/lib/swagger.js) so that the raw json-schema model is visible from Docson. Either replace the `swagger.js` file in your Swagger UI disctribution or take it directly from github by replacing\n\n```html\n   \u003cscript src='/lib/swagger.js' type='text/javascript'\u003e\u003c/script\u003e\n```\n\nwith \n\n```html\n  \u003cscript src='https://raw2.github.com/lbovet/swagger-js/models-exposed/lib/swagger.js' type='text/javascript'\u003e\u003c/script\u003e\n```\n\nFor a better layout of parameter models, you may [want to change the width of some elements](https://github.com/lbovet/swagger-ui/blob/3f37722b03db6c48cc2a8460df26dda5f4d6f8e4/src/main/html/index.html#L20-L27):\n\n```html\n  \u003cstyle\u003e\n      .swagger-ui-wrap {\n          max-width: 1200px;\n      }\n      .swagger-ui-wrap .body-textarea {\n          width: 200px;\n      }\n  \u003c/style\u003e\n```\n\n## Integration\n\nYou can also integrate Docson in your application and use its javascript API:\n\n```javascript\ndocson.doc(element, schema, ref)\n```\n\n* `element` is the element which will host the documentation. Either a DOM element (id or object) or jQuery element.\n* `schema` is the URI or path to the schema or a string containing the schema source itself.\n* `ref` is an optional json-pointer path to a sub-schema.\n\nExamples:\n* [Simple integration example](http://lbovet.github.io/docson/examples/example.html)\n* [See it in action](http://lbovet.github.io/typson-demo/) with its buddy [typson](https://github.com/lbovet/typson).\n\n## Limitations\n\n* Mixing unrelated keywords can lead to unexpected results.\n\nNot implemented:\n* Non-primitive values in enums and default values\n* dependencies, additionalItems, patternProperties\n\n## Development\n\n* [All tests](http://lbovet.github.io/docson/tests/test.html)\n\nPlease pull-request your failing schemas in the `tests/` folder and open an issue describing the expected result.\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lbovet/docson/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbovet%2Fdocson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbovet%2Fdocson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbovet%2Fdocson/lists"}