{"id":22765422,"url":"https://github.com/kubajastrz/openapi-generator-example","last_synced_at":"2026-04-11T13:10:07.196Z","repository":{"id":119559291,"uuid":"384479835","full_name":"KubaJastrz/openapi-generator-example","owner":"KubaJastrz","description":"Example usage of openapi-generator and msw","archived":false,"fork":false,"pushed_at":"2021-10-12T15:55:33.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:44:56.200Z","etag":null,"topics":["example","generator","mock-service-worker","openapi","openapi-generator","react","typescript","vite"],"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/KubaJastrz.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}},"created_at":"2021-07-09T15:33:02.000Z","updated_at":"2021-10-12T15:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd7c2204-d883-408d-92b4-784bda90a034","html_url":"https://github.com/KubaJastrz/openapi-generator-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KubaJastrz%2Fopenapi-generator-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KubaJastrz%2Fopenapi-generator-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KubaJastrz%2Fopenapi-generator-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KubaJastrz%2Fopenapi-generator-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KubaJastrz","download_url":"https://codeload.github.com/KubaJastrz/openapi-generator-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246302782,"owners_count":20755654,"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":["example","generator","mock-service-worker","openapi","openapi-generator","react","typescript","vite"],"created_at":"2024-12-11T12:13:08.293Z","updated_at":"2025-12-30T23:16:38.239Z","avatar_url":"https://github.com/KubaJastrz.png","language":"TypeScript","readme":"# OpenAPI Generator Example\n\nThis is an example usage of [openapi-generator](https://github.com/OpenAPITools/openapi-generator) with [typescript-fetch](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/typescript-fetch.md) generator.\n\n## Getting Started\n\nRequirements:\n\n- node v12+\n- yarn v1\n- docker (for generating the api client)\n\nInstallation:\n\n1. Clone the repository\n2. Install dependencies\n   ```bash\n   yarn --frozen-lockfile\n   ```\n3. Generate the API client\n   ```bash\n   yarn generate-api\n   ```\n4. Run the application at [http://localhost:3000](http://localhost:3000)\n   ```bash\n   yarn dev\n   ```\n\n## Generating API client from schema\n\nTo (re-)generate the API client from schema, run:\n\n```bash\nyarn generate-api\n```\n\nIt will read the `schema.yml` file in the working directory and pass it into the generator.\nIt can be customized by passing the schema filename:\n\n```bash\nyarn generate-api custom-schema.yml\n```\n\nThe generated output will be in the `src/api/generated-api` directory.\n\n## How it works\n\n![Generator Flow Diagram](docs/generator-flow.svg)\n\nOpenAPI Generator imports specified `schema.yml` file and generates the API classes in `src/api/generated-api` directory.\n\nThe application creates ready-for-use API client with helpers for authentication in `src/api/index.ts`.\n\nComponents import API client methods and make API calls.\n\nAPI calls are intercepted in development environment with Mock Service Worker and optionally served with mocked data on demand. In production environment the interceptor is disabled removed from the application bundle.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubajastrz%2Fopenapi-generator-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubajastrz%2Fopenapi-generator-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubajastrz%2Fopenapi-generator-example/lists"}