{"id":27488255,"url":"https://github.com/jorgermduarte/openapi-interface-generator","last_synced_at":"2025-06-10T15:06:16.613Z","repository":{"id":287633749,"uuid":"965332733","full_name":"jorgermduarte/openapi-interface-generator","owner":"jorgermduarte","description":"A simple TypeScript utility to generate strongly typed contracts based on an OpenAPI YAML specification.","archived":false,"fork":false,"pushed_at":"2025-04-15T13:59:19.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T08:54:49.999Z","etag":null,"topics":["api","contracts","generator","interfaces","interfaces-api","openapi","openapi-generator","yaml"],"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/jorgermduarte.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,"zenodo":null}},"created_at":"2025-04-12T23:27:20.000Z","updated_at":"2025-04-15T13:59:22.000Z","dependencies_parsed_at":"2025-04-13T00:25:26.001Z","dependency_job_id":null,"html_url":"https://github.com/jorgermduarte/openapi-interface-generator","commit_stats":null,"previous_names":["jorgermduarte/openapi-interface-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fopenapi-interface-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fopenapi-interface-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fopenapi-interface-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fopenapi-interface-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgermduarte","download_url":"https://codeload.github.com/jorgermduarte/openapi-interface-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fopenapi-interface-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259098440,"owners_count":22804783,"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":["api","contracts","generator","interfaces","interfaces-api","openapi","openapi-generator","yaml"],"created_at":"2025-04-16T19:55:39.958Z","updated_at":"2025-06-10T15:06:16.591Z","avatar_url":"https://github.com/jorgermduarte.png","language":"TypeScript","readme":"# openapi-interface-generator\n\nA simple TypeScript utility to generate strongly typed contracts (input, output, and interfaces) based on an OpenAPI YAML specification. This tool helps backend and frontend developers work with consistent request and response types.\n\n## Features\n\n- Generate TypeScript interfaces from OpenAPI schemas\n- Organize input (request), output (response), and controller interfaces\n- Supports nested objects and `$ref` references\n- Fully configurable output paths\n\n---\n\n## 🛠 Installation\n\n```bash\nnpm install --save-dev openapi-interface-generator\n```\n\n## 🚀 Usage\n\n### Option 1: Add it to your npm scripts\n\nAdd this to your package.json:\n\n```bash\n\"scripts\": {\n    \"generate-interfaces\": \"openapi-interface-generator --openApiPath=./openapi.yaml --generatedDir=./src/app/contracts --interfacesFolder=interfaces --requestsFolder=requests --responsesFolder=responses\"\n}\n```\n\n### Option 2: CLI\n\n```bash\nopenapi-interface-generator  \\\n  --openApiPath=./openapi.yaml \\\n  --generatedDir=./src/app/contracts \\\n  --interfacesFolder=interfaces \\\n  --requestsFolder=requests \\\n  --responsesFolder=responses\n```\n\n\n### Running using the npm script\n```bash\nnpm run generate-interfaces\n```\n\n## ⚙ CLI Options\n\n| Option               | Description                                  | Default                  |\n|----------------------|----------------------------------------------|--------------------------|\n| `--openApiPath`      | Path to OpenAPI YAML file                    | `./openapi.yaml`         |\n| `--generatedDir`     | Base output folder for all contracts         | `./src/app/contracts`    |\n| `--interfacesFolder` | Folder for generated Express interfaces      | `interfaces`             |\n| `--requestsFolder`   | Folder for generated request DTOs            | `requests`               |\n| `--responsesFolder`  | Folder for generated response DTOs           | `responses`              |\n\n\n\n## 📂 Output Structure\n\n```bash\n/contracts\n  ├── interfaces\n  │   └── tag-name-interface.ts     \u003c-- Controller interfaces\n  ├── requests\n  │   └── tag-name.request.ts       \u003c-- Input DTOs\n  └── responses\n      └── tag-name.response.ts      \u003c-- Output DTOs\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgermduarte%2Fopenapi-interface-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgermduarte%2Fopenapi-interface-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgermduarte%2Fopenapi-interface-generator/lists"}