{"id":18484900,"url":"https://github.com/redocly/json-to-json-schema","last_synced_at":"2025-06-30T09:37:42.235Z","repository":{"id":41207762,"uuid":"470442887","full_name":"Redocly/json-to-json-schema","owner":"Redocly","description":"Convert JSON examples into JSON schema (supports Swagger 2, OpenAPI 3 and 3.1)","archived":false,"fork":false,"pushed_at":"2024-07-09T12:53:52.000Z","size":187,"stargazers_count":28,"open_issues_count":6,"forks_count":5,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-06-26T11:26:15.564Z","etag":null,"topics":["json-schema","openapi","openapi3","swagger"],"latest_commit_sha":null,"homepage":"https://redocly.com/tools/json-to-json-schema","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Redocly.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":"2022-03-16T05:21:04.000Z","updated_at":"2025-02-25T17:35:12.000Z","dependencies_parsed_at":"2024-11-06T12:48:51.111Z","dependency_job_id":"dc48a662-e7ff-40cb-a318-4ca0111a79f8","html_url":"https://github.com/Redocly/json-to-json-schema","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"ee8e79288c445829146f0f0cf733b2b9398b4199"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Redocly/json-to-json-schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redocly%2Fjson-to-json-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redocly%2Fjson-to-json-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redocly%2Fjson-to-json-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redocly%2Fjson-to-json-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Redocly","download_url":"https://codeload.github.com/Redocly/json-to-json-schema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redocly%2Fjson-to-json-schema/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262748952,"owners_count":23358305,"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":["json-schema","openapi","openapi3","swagger"],"created_at":"2024-11-06T12:43:32.683Z","updated_at":"2025-06-30T09:37:42.227Z","avatar_url":"https://github.com/Redocly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-to-json-schema\n\n[![npm version](https://badgen.net/npm/v/@redocly/json-to-json-schema)](https://www.npmjs.com/package/@redocly/json-to-json-schema) [![bundle size](https://badgen.net/bundlephobia/min/@redocly/json-to-json-schema)](https://bundlephobia.com/package/@redocly/json-to-json-schema) [![dependency size](https://badgen.net/bundlephobia/dependency-count/@redocly/json-to-json-schema)](https://bundlephobia.com/package/@redocly/json-to-json-schema) [![Coverage Status](https://coveralls.io/repos/github/Redocly/json-to-json-schema/badge.svg?branch=main)](https://coveralls.io/github/Redocly/json-to-json-schema?branch=main)\n\nConvert JSON examples into JSON schema.\n\nSupports JSON Schema `draft-05` used in Swagger 2.0 and OpenAPI 3.0 and new draft `draft-2020-12` used in OpenAPI 3.1.\n\n## Usage\n\n```js\nimport { convert, format } from '@redocly/json-to-json-schema';\n\nconst example = { firstname: 'John', surname: 'Doe', birthday: '1990-02-23' };\n\nconst schema = convert(example, {\n  target: 'draft-05-oas', // or draft-2020-12\n  includeExamples: false,\n  disableAdditionalProperties: false,\n  inferRequired: false,\n});\n```\n\nOutput:\n\n```yaml\nfirstname:\n  type: string\nsurname:\n  type: string\nbirthday:\n  type: string\n  format: date\n```\n\n## Similar tools\n\nhttps://github.com/mohsen1/json-to-json-schema\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredocly%2Fjson-to-json-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredocly%2Fjson-to-json-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredocly%2Fjson-to-json-schema/lists"}