{"id":15391687,"url":"https://github.com/jahredhope/demo-json-schema-extends-typescript","last_synced_at":"2025-07-22T09:31:39.823Z","repository":{"id":40440739,"uuid":"280061043","full_name":"jahredhope/demo-json-schema-extends-typescript","owner":"jahredhope","description":"Demononstrate behavior of json-schema-to-typescript when extending schemas","archived":false,"fork":false,"pushed_at":"2022-06-26T09:50:57.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-14T06:13:33.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jahredhope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-16T05:20:56.000Z","updated_at":"2020-07-16T23:53:20.000Z","dependencies_parsed_at":"2022-09-04T21:52:49.944Z","dependency_job_id":null,"html_url":"https://github.com/jahredhope/demo-json-schema-extends-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jahredhope/demo-json-schema-extends-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahredhope%2Fdemo-json-schema-extends-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahredhope%2Fdemo-json-schema-extends-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahredhope%2Fdemo-json-schema-extends-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahredhope%2Fdemo-json-schema-extends-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jahredhope","download_url":"https://codeload.github.com/jahredhope/demo-json-schema-extends-typescript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahredhope%2Fdemo-json-schema-extends-typescript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266465060,"owners_count":23933053,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-01T15:12:12.377Z","updated_at":"2025-07-22T09:31:39.773Z","avatar_url":"https://github.com/jahredhope.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo json-schema-to-typescript\n\nThis repository demonstrates the different behaviours between `allOf` and `extends` in generated types using json-schema-to-typescript.\n\nThis repository contains folders with different implementations where multiple child schemas extend a parent schema. In this case the children `Circle` and `Square` both extend `Shape`.\n\nBoth of these folders have generated `types.d.ts` files with some differences.\n\n- The use of `extend` creates the more ideal TypeScript definition however it duplicates the shape definition as `Shape` and `Shape1`.\n- The use of `allOf` does not duplicate these definitions.\n\nWhen using `allOf` reused references are declared once and reused.\n\n- [Type definition example](./allOf/types.d.ts)\n- [Source code](./allOf/square.json)\n\nWhen using `extends` reused references are duplicated.\n\n- [Type definition example](./extends/types.d.ts)\n- [Source code](./extends/square.json)\n\n### Setup\n\nInstall dependencies\n\n```bash\n$ yarn\n```\n\nBuild the type definitions\n\n```bash\n$ yarn build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjahredhope%2Fdemo-json-schema-extends-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjahredhope%2Fdemo-json-schema-extends-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjahredhope%2Fdemo-json-schema-extends-typescript/lists"}