{"id":26442145,"url":"https://github.com/ontodevelopment/json-schema-doc-ts","last_synced_at":"2026-04-17T15:33:48.228Z","repository":{"id":282780212,"uuid":"946411348","full_name":"OntoDevelopment/json-schema-doc-ts","owner":"OntoDevelopment","description":"Generate documentation for JSON Schemas","archived":false,"fork":false,"pushed_at":"2025-03-17T05:00:02.000Z","size":1101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T05:05:30.013Z","etag":null,"topics":["documentation","json","json-schema"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OntoDevelopment.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T05:11:43.000Z","updated_at":"2025-03-17T04:51:15.000Z","dependencies_parsed_at":"2025-03-17T05:05:30.408Z","dependency_job_id":null,"html_url":"https://github.com/OntoDevelopment/json-schema-doc-ts","commit_stats":null,"previous_names":["ontodevelopment/json-schema-doc","ontodevelopment/json-schema-doc-ts"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OntoDevelopment%2Fjson-schema-doc-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OntoDevelopment%2Fjson-schema-doc-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OntoDevelopment%2Fjson-schema-doc-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OntoDevelopment%2Fjson-schema-doc-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OntoDevelopment","download_url":"https://codeload.github.com/OntoDevelopment/json-schema-doc-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244198395,"owners_count":20414443,"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":["documentation","json","json-schema"],"created_at":"2025-03-18T10:17:46.553Z","updated_at":"2026-04-17T15:33:48.181Z","avatar_url":"https://github.com/OntoDevelopment.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-schema-doc-ts\n\n**NOTE:** This module supports [json-schema.org](https://json-schema.org/) `draft-7`. Previous drafts may not generate documentation correctly.\n\n## Generate markdown documentation for JSON Schemas\n\n[Click here](https://github.com/BrianWendt/json-schema-md-doc/tree/master/samples/node) to see the Node example.\n\nIf you just need to quickly create markdown from a JSON schema, use the [online tool](https://brianwendt.github.io/json-schema-md-doc/).\n\n### Simple Implementation\n\n**es6 and later**\n\n```\nnpm install json-schema-doc-ts\n```\n\n```javascript\nimport { JSONSchemaMarkdownDoc } from \"json-schema-doc-ts\";\n\n// simple schema for the example\nconst colors_schema = {\n    description: \"Choose a color\",\n    type: \"string\",\n    enum: [\"red\", \"amber\", \"green\"],\n};\n\n// create an instance of JSONSchemaMarkdownDoc and load the schema\nconst Doccer = new JSONSchemaMarkdownDoc(colors_schema);\n// generate the markdown\nconsole.log(Doccer.generate());\n```\n\n**Result**\n\n```markdown\n_Choose a color_\n\nType: `string`\n\n_path: #_\n\nThe value is restricted to the following:\n\n1.  _\"red\"_\n2.  _\"amber\"_\n3.  _\"green\"_\n\n_Generated with [OntoDevelopment/json-schema-doc-ts](https://github.com/OntoDevelopment/json-schema-doc-ts)_\n```\n\n### Extendabale\n\nYou may easily extend `JSONSchemaMarkdownDoc` to customize the formatting of your markdown by overriding any method.\n\n```typescript\nimport { JSONSchemaMarkdownDoc } from \"json-schema-doc-ts\";\n\nclass MyDoccer extends JSONSchemaMarkdownDoc {\n    footer = \"Thanks for reading the documentation!\";\n    valueBool(bool: boolean | string) {\n        if (typeof bool === \"string\") {\n            return bool;\n        } else {\n            return bool ? \"TRUE\" : \"FALSE\"; //uppercase instead of true/false\n        }\n    }\n}\n```\n\n## Generate documentation in other formats for JSON Schemas\n\nThis project may add a JSONSchemaHtmlDoc (JSON Schema to HTML documentation) class in the future. This is a small sample of what that might look like.\n\n```typescript\nimport { JSONSchemaDocAbstract } from \"json-schema-doc-ts\";\n\nclass JSONSchemaHtmlDoc extends JSONSchemaDocAbstract {\n    writeLine(text: string = \"\", level: number = 1): this {\n        this.response += '\u003cp style=\"padding-left: ' + level + 'em\"\u003e' + text + \"\u003c/p\u003e\";\n        return this;\n    }\n    // ...\n}\n```\n\n## Unit Testing\nUnit tests built with vitest.\nSee [github.com/OntoDevelopment/json-schema-doc-tests](https://github.com/OntoDevelopment/json-schema-doc-tests)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fontodevelopment%2Fjson-schema-doc-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fontodevelopment%2Fjson-schema-doc-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fontodevelopment%2Fjson-schema-doc-ts/lists"}