{"id":31655826,"url":"https://github.com/carminepo2/openapi-ts-rest","last_synced_at":"2025-10-07T13:52:19.770Z","repository":{"id":243565927,"uuid":"802595227","full_name":"Carminepo2/openapi-ts-rest","owner":"Carminepo2","description":"A simple tool to generate a ts-rest contract (with zod validation) from an OpenAPI 3.0/3.1 specification.","archived":false,"fork":false,"pushed_at":"2025-10-06T22:46:45.000Z","size":1153,"stargazers_count":30,"open_issues_count":16,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-07T00:21:07.101Z","etag":null,"topics":["generator","openapi","ts-rest"],"latest_commit_sha":null,"homepage":"https://openapi-ts-rest.pages.dev/","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/Carminepo2.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-18T18:27:49.000Z","updated_at":"2025-09-11T01:33:30.000Z","dependencies_parsed_at":"2024-09-09T17:32:23.639Z","dependency_job_id":"889b6eb9-edfe-45d6-a1e3-ce6aeab15b80","html_url":"https://github.com/Carminepo2/openapi-ts-rest","commit_stats":null,"previous_names":["carminepo2/openapi-ts-rest-contract","carminepo2/openapi-ts-rest"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Carminepo2/openapi-ts-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carminepo2%2Fopenapi-ts-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carminepo2%2Fopenapi-ts-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carminepo2%2Fopenapi-ts-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carminepo2%2Fopenapi-ts-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Carminepo2","download_url":"https://codeload.github.com/Carminepo2/openapi-ts-rest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carminepo2%2Fopenapi-ts-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786690,"owners_count":26045588,"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-10-07T02:00:06.786Z","response_time":59,"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":["generator","openapi","ts-rest"],"created_at":"2025-10-07T13:52:11.574Z","updated_at":"2025-10-07T13:52:19.765Z","avatar_url":"https://github.com/Carminepo2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi-ts-rest\n\n![NPM Version](https://img.shields.io/npm/v/%40openapi-ts-rest%2Fcore)\n[![CI](https://github.com/Carminepo2/openapi-ts-rest/actions/workflows/ci.yml/badge.svg)](https://github.com/Carminepo2/openapi-ts-rest/actions/workflows/ci.yml)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=openapi-ts-rest-core\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=openapi-ts-rest-core)\n\n\u003e [!WARNING]  \n\u003e This project is still in development and is not ready for production use, there may be bugs, missing features and breaking changes.\n\u003e Use at your own risk.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/images/openapi-ts-rest-avatar-light.png\" /\u003e\n\u003c/p\u003e\n\nA simple tool to generate a [ts-rest](https://github.com/ts-rest/ts-rest) contract (with zod validation) from an OpenAPI 3.0/3.1 specification.\n\n\u003cp align=\"center\"\u003e\n  ---\u003e \u003ca href=\"https://openapi-ts-rest.pages.dev/\"\u003eTry it in the online playground!\u003c/a\u003e \u003c---\n\u003c/p\u003e\n    \n## Installation 📦\n\nYou can use `openapi-ts-rest` in two ways: as a CLI tool or as a core library within your code.\n\n### CLI Installation\n\n```sh\npnpm add @openapi-ts-rest/cli\n```\n\n### Core Library Installation\n\n```sh\npnpm add @openapi-ts-rest/core\n```\n\n## Usage 🚀\n\n### CLI Usage\n\n```sh\n# If installed globally\nopenapi-ts-rest path/to/openapi-spec.yaml -o path/to/output/dir\n# If installed in a project\nnpx openapi-ts-rest path/to/openapi-spec.yaml -o path/to/output/dir\n```\n\n- `-o`, `--output`: Directory where the generated TypeScript files will be saved.\n\n### Core Library Usage\n\nIf you prefer to integrate the functionality directly into your code, you can do so with the core library:\n\n```typescript\nimport { generateContract } from \"@openapi-ts-rest/core\";\nimport fs from \"fs\";\n\nconst result = await generateContract({ openApi: \"path/to/openapi-spec.yaml\" });\nfs.writeFileSync(\"path/to/output/dir\", result);\n```\n\n## Features ✨\n\n- **OpenAPI 3.0/3.1 Support**: Full support for the latest OpenAPI specifications.\n- **Flexible Usage**: Use the CLI for quick operations or the core library for deeper integration.\n- **Zod Schema Generation**: Automatically generate Zod schemas for runtime validation.\n\n## Contributing 🤝\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## Special Thanks 🙏\n\nThis project is heavily inspired by [openapi-zod-client](https://github.com/astahmer/openapi-zod-client).\nSpecial thanks to the author for their work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarminepo2%2Fopenapi-ts-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarminepo2%2Fopenapi-ts-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarminepo2%2Fopenapi-ts-rest/lists"}