{"id":28471808,"url":"https://github.com/ptpt/json-schema-ts","last_synced_at":"2026-04-27T18:34:58.285Z","repository":{"id":45272938,"uuid":"162266155","full_name":"ptpt/json-schema-ts","owner":"ptpt","description":"JSON Schema for TypeScript","archived":false,"fork":false,"pushed_at":"2021-12-25T22:56:04.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-06T11:06:26.711Z","etag":null,"topics":["json-schema","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ptpt.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}},"created_at":"2018-12-18T09:49:14.000Z","updated_at":"2021-12-25T22:56:05.000Z","dependencies_parsed_at":"2022-09-19T08:20:15.820Z","dependency_job_id":null,"html_url":"https://github.com/ptpt/json-schema-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ptpt/json-schema-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptpt%2Fjson-schema-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptpt%2Fjson-schema-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptpt%2Fjson-schema-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptpt%2Fjson-schema-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ptpt","download_url":"https://codeload.github.com/ptpt/json-schema-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptpt%2Fjson-schema-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32238748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","typescript"],"created_at":"2025-06-07T11:08:56.157Z","updated_at":"2026-04-27T18:34:58.277Z","avatar_url":"https://github.com/ptpt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Schema for TypeScript\n\nThis package provides:\n\n1. JSON schema types for TypeScript (in namespace `t`)\n2. a builder for building JSON schema (in namespace `s`)\n3. infer the type given the JSON schema built by the builder (with `t.TSType\u003cT\u003e`)\n\n## Installation\n\n```\nnpm install json-schema-ts\n```\n\n## Examples\n\n```typescript\nimport {s, t} from 'json-schema-ts';\n\nconst sex = s.string\u003c'male' | 'female'\u003e({'enum': ['male', 'female']});\n\n// personSchema is a valid JSON schema\nconst personSchema = s.object({\n    'title': 'person',\n    'description': 'Person information',\n    'definitions': {\n        'sex': sex,\n    },\n    'properties': {\n        'name': s.string(),\n        'fullName': s.object({'properties': {\n            'firstName': s.string(),\n            'lastName': s.string(),\n        }}),\n        'age': s.number(),\n        'friends': s.array({'items': s.string()}),\n        'sex': s.ref\u003ctypeof sex\u003e('#/definitions/sex'),\n        'location': s.oneOf(\n            s.string(),\n            s.tuple({'items': s.items(s.number(), s.number())}),\n        )\n    }\n});\n\n// Infer IPerson from personSchema\ntype IPerson = t.TSType\u003ctypeof personSchema\u003e;\n\n// IPerson is equivalent to\n// interface IPerson {\n//     name: string;\n//     fullName: {\n//         firstName: string,\n//         lastName: string,\n//     };\n//     age: number;\n//     friends: string[];\n//     sex: 'male' | 'female';\n//     location: string | [number, number];\n// }\n```\n\n## Development\n\n```\nnpx tsc -w\n```\n\n## License\nMIT. See LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptpt%2Fjson-schema-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fptpt%2Fjson-schema-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptpt%2Fjson-schema-ts/lists"}