{"id":31644423,"url":"https://github.com/slaterhaus/openapi-sdk-generator","last_synced_at":"2026-05-04T09:32:07.177Z","repository":{"id":314816682,"uuid":"1056852885","full_name":"slaterhaus/openapi-sdk-generator","owner":"slaterhaus","description":"Generate TypeScript SDKs, Postman collections, GraphQL schemas, and cURL commands from OpenAPI specifications","archived":false,"fork":false,"pushed_at":"2025-09-14T23:41:05.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T04:56:34.409Z","etag":null,"topics":["api-client","cli-tool","code-generator","graphql","openapi","postman","swagger","typescript"],"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/slaterhaus.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":"2025-09-14T23:38:48.000Z","updated_at":"2025-09-14T23:41:08.000Z","dependencies_parsed_at":"2025-09-15T01:18:19.996Z","dependency_job_id":"af14e35b-72d1-45c5-ae8b-83fedadd1762","html_url":"https://github.com/slaterhaus/openapi-sdk-generator","commit_stats":null,"previous_names":["slaterhaus/openapi-sdk-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/slaterhaus/openapi-sdk-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaterhaus%2Fopenapi-sdk-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaterhaus%2Fopenapi-sdk-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaterhaus%2Fopenapi-sdk-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaterhaus%2Fopenapi-sdk-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slaterhaus","download_url":"https://codeload.github.com/slaterhaus/openapi-sdk-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaterhaus%2Fopenapi-sdk-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32601513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"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":["api-client","cli-tool","code-generator","graphql","openapi","postman","swagger","typescript"],"created_at":"2025-10-07T04:52:36.726Z","updated_at":"2026-05-04T09:32:07.160Z","avatar_url":"https://github.com/slaterhaus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI SDK Generator\n\n🚀 Generate TypeScript SDKs, Postman collections, GraphQL schemas, and cURL commands from OpenAPI specifications\n\n## Features\n\n- **TypeScript SDK Generation** - Type-safe API clients with full IntelliSense support\n- **Postman Collections** - Ready-to-import collections compatible with Postman \u0026 Insomnia\n- **GraphQL Schema Generation** - Convert REST APIs to GraphQL schemas with resolvers\n- **cURL Commands** - Copy-paste ready cURL commands with example data\n- **Multiple Input Formats** - Support for JSON, YAML, and YML OpenAPI specs\n- **Clean Code Generation** - Well-structured, readable output following best practices\n\n## Installation\n\n```bash\nnpm install -g openapi-sdk-gen\n```\n\n## Quick Start\n\n```bash\n# Generate TypeScript SDK\nopenapi-sdk-gen api.yaml\n\n# Generate Postman collection\nopenapi-postman api.yaml\n\n# Generate GraphQL schema\nopenapi-graphql api.yaml\n\n# Generate cURL commands\nopenapi-postman api.yaml --format curl\n```\n\n## CLI Tools\n\n### TypeScript SDK Generator\n\nGenerate a complete TypeScript SDK with types and API client:\n\n```bash\nopenapi-sdk-gen \u003cinput-file\u003e [output-dir]\n\n# Examples\nopenapi-sdk-gen petstore.yaml\nopenapi-sdk-gen schema.json ./my-sdk\n```\n\n**Generated files:**\n- `types.ts` - TypeScript interfaces and types\n- `client.ts` - API client class with methods\n- `index.ts` - Main exports\n\n### Postman Collection Generator\n\nCreate Postman collections or cURL commands:\n\n```bash\nopenapi-postman \u003cinput-file\u003e [options]\n\nOptions:\n  --output, -o  Output file path\n  --format, -f  Output format: postman|curl\n  --help, -h    Show help\n\n# Examples\nopenapi-postman api.yaml\nopenapi-postman api.yaml --output collection.json\nopenapi-postman api.yaml --format curl --output commands.txt\n```\n\n### GraphQL Schema Generator\n\nConvert OpenAPI specs to GraphQL schemas:\n\n```bash\nopenapi-graphql \u003cinput-file\u003e [options]\n\nOptions:\n  --output, -o  Output file path\n  --format, -f  Output format: schema|json\n  --help, -h    Show help\n\n# Examples\nopenapi-graphql api.yaml\nopenapi-graphql api.yaml --output schema.graphql\nopenapi-graphql api.yaml --format json --output structure.json\n```\n\n## Example Usage\n\n### Input: OpenAPI Specification\n\n```yaml\nopenapi: 3.0.3\ninfo:\n  title: Pet Store API\n  version: 1.0.0\npaths:\n  /pets:\n    get:\n      operationId: listPets\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/Pet'\ncomponents:\n  schemas:\n    Pet:\n      type: object\n      required: [id, name]\n      properties:\n        id: {type: string}\n        name: {type: string}\n```\n\n### Generated TypeScript SDK\n\n```typescript\n// types.ts\nexport interface Pet {\n  id: string;\n  name: string;\n}\n\n// client.ts\nimport { Pet } from './types';\n\nexport class PetStoreAPIClient {\n  constructor(private baseUrl: string) {}\n\n  async listPets(): Promise\u003cPet[]\u003e {\n    // Implementation...\n  }\n}\n```\n\n### Generated Postman Collection\n\n```json\n{\n  \"info\": { \"name\": \"Pet Store API\" },\n  \"item\": [{\n    \"name\": \"listPets\",\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"{{baseUrl}}/pets\"\n    }\n  }]\n}\n```\n\n### Generated GraphQL Schema\n\n```graphql\ntype Pet {\n  id: String!\n  name: String!\n}\n\ntype Query {\n  listPets: [Pet]\n}\n```\n\n### Generated cURL Commands\n\n```bash\n# GET /pets - List all pets\ncurl -X GET \"https://api.example.com/pets\"\n```\n\n## Compatibility\n\n- **Postman** - Full compatibility with generated collections\n- **Insomnia** - Collections work seamlessly (basic features)\n- **OpenAPI 3.0+** - Full support for OpenAPI 3.0 and 3.1 specifications\n- **Node.js** - Requires Node.js 16+ for CLI tools\n- **TypeScript** - Generated SDKs work with TypeScript 4.0+\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-username/openapi-sdk-gen.git\ncd openapi-sdk-gen\n\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n\n# Test with example\nnpm run generate example-petstore.yaml\n```\n\n## Library Usage\n\nYou can also use the generators programmatically:\n\n```typescript\nimport {\n  OpenAPIParser,\n  SDKGenerator,\n  PostmanGenerator,\n  GraphQLGenerator\n} from 'openapi-sdk-gen';\n\nconst spec = OpenAPIParser.parse('api.yaml');\n\n// Generate SDK\nconst sdkGen = new SDKGenerator(spec);\nconst sdk = sdkGen.generateClient();\n\n// Generate Postman collection\nconst postmanGen = new PostmanGenerator(spec);\nconst collection = postmanGen.generateCollection();\n\n// Generate GraphQL schema\nconst graphqlGen = new GraphQLGenerator(spec);\nconst schema = graphqlGen.generateGraphQLSchema();\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Author\n\nThomas James Slater\n\n---\n\n**Keywords:** openapi, swagger, typescript, postman, graphql, api-client, code-generator, rest-api","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslaterhaus%2Fopenapi-sdk-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslaterhaus%2Fopenapi-sdk-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslaterhaus%2Fopenapi-sdk-generator/lists"}