{"id":39962977,"url":"https://github.com/simonireilly/compeller","last_synced_at":"2026-01-18T21:32:08.150Z","repository":{"id":37638266,"uuid":"452000471","full_name":"simonireilly/compeller","owner":"simonireilly","description":"A strong typescript binding for your OpenAPI Schema that doesn't need generation and is not prescriptive in coding style","archived":false,"fork":false,"pushed_at":"2022-02-26T16:36:15.000Z","size":1462,"stargazers_count":22,"open_issues_count":14,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-27T17:30:18.989Z","etag":null,"topics":["json-schema","openapi","openapi3","schema","swagger"],"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/simonireilly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-25T18:44:08.000Z","updated_at":"2024-08-13T03:40:21.000Z","dependencies_parsed_at":"2022-08-11T03:30:18.969Z","dependency_job_id":null,"html_url":"https://github.com/simonireilly/compeller","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/simonireilly/compeller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonireilly%2Fcompeller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonireilly%2Fcompeller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonireilly%2Fcompeller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonireilly%2Fcompeller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonireilly","download_url":"https://codeload.github.com/simonireilly/compeller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonireilly%2Fcompeller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27464320,"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-12-02T02:00:06.387Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["json-schema","openapi","openapi3","schema","swagger"],"created_at":"2026-01-18T21:32:08.072Z","updated_at":"2026-01-18T21:32:08.142Z","avatar_url":"https://github.com/simonireilly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compeller\n\nA strong typescript binding for your OpenAPI Schema that doesn't need generation, and isn't prescriptive.\n\n![how to get started with compeller](./assets/usage.gif)\n\n\n- [Compeller](#compeller)\n  - [🚨 Alpha software 🚨](#-alpha-software-)\n  - [About](#about)\n  - [Get started](#get-started)\n  - [🛣️ Road map](#️-road-map)\n    - [Usage](#usage)\n  - [Shoulders](#shoulders)\n\n## 🚨 Alpha software 🚨\n\nCompeller is in alpha, so it's API might change, maybe you have some thoughts?\n\n## About\n\nCompeller tries to infer your OpenAPI validations and responses, from a typed OpenAPI specification.\n\n## Get started\n\nYou can use the CLI to start a new project, generating an OpenAPI specification.\n\n```bash\nnpx compeller@alpha new\n```\n\n## 🛣️ Road map\n\n- [x] Support for request body validation to type guard (ajv)\n- [x] Support for header response types\n- [ ] Support for response type mapping\n- [ ] Support for path validation\n- [ ] Support header validation\n\n### Usage\n\nCreate a Schema specification for an API Model like:\n\n```ts\n// ./examples/standalone/openapi/schemas/version.schema.ts\n\nimport { FromSchema } from 'json-schema-to-ts';\n\nexport const VersionSchema = {\n  type: 'object',\n  required: ['version'],\n  additionalProperties: false,\n  properties: {\n    version: {\n      type: 'string',\n    },\n  },\n} as const;\n\nexport type Version = FromSchema\u003ctypeof VersionSchema\u003e;\n\n```\n\nNext, bind the model into an OpenAPI specification object.\n\n```ts\n// ./examples/standalone/openapi/spec.ts\n\nimport { VersionSchema } from './schemas/version.schema';\n\nexport const OpenAPISpecification = {\n  info: {\n    title: 'New API generated with compeller',\n    version: '1.0.0',\n  },\n  openapi: '3.1.0',\n  paths: {\n    'v1/version': {\n      get: {\n        responses: {\n          '200': {\n            description: 'Get the current API version',\n            content: {\n              'application/json': {\n                schema: VersionSchema,\n              },\n            },\n          },\n        },\n      },\n    },\n  },\n};\n\n```\n\nWith compeller you can compile this into a typed request and response handler like:\n\n```ts\nimport { OpenAPISpecification } from './spec';\n\n// The api is inferred, and validations are generated\nconst api = compeller(OpenAPISpecification);\n\n// These routes and methods are enforced\nconst { response } = api('/v1/version', 'get');\n\n// The response code and body schema are bound\nconst resp = response('200', { name: 'Type-safe reply' });\n```\n\nSee [./examples](./examples)\n\n## Shoulders\n\nCompell is built on top of some great libraries, at it's core it relies on:\n\n- [openapi3-ts](https://github.com/metadevpro/openapi3-ts)\n- [json-schema-to-ts](https://github.com/ThomasAribart/json-schema-to-ts)\n\nIt also layers on request and response validation powered by:\n\n- [ajv](https://github.com/ajv-validator/ajv)\n\nI'm grateful for these libraries\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonireilly%2Fcompeller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonireilly%2Fcompeller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonireilly%2Fcompeller/lists"}