{"id":18494110,"url":"https://github.com/workleap/wl-openapi-typescript","last_synced_at":"2025-04-08T22:31:00.391Z","repository":{"id":242597929,"uuid":"809963219","full_name":"workleap/wl-openapi-typescript","owner":"workleap","description":"Code generator for OpenAPI schemas","archived":false,"fork":false,"pushed_at":"2025-04-07T02:46:15.000Z","size":1655,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-04-07T03:30:29.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://workleap.github.io/wl-openapi-typescript/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workleap.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-03T19:36:26.000Z","updated_at":"2025-02-18T22:21:46.000Z","dependencies_parsed_at":"2024-07-29T20:25:09.512Z","dependency_job_id":"40f0530a-275c-445f-b43b-c9bb6d2a7c3b","html_url":"https://github.com/workleap/wl-openapi-typescript","commit_stats":null,"previous_names":["gsoft-inc/wl-openapi-typescript","workleap/wl-openapi-typescript"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-openapi-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-openapi-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-openapi-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-openapi-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workleap","download_url":"https://codeload.github.com/workleap/wl-openapi-typescript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247939965,"owners_count":21021880,"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":[],"created_at":"2024-11-06T13:18:00.250Z","updated_at":"2025-04-08T22:30:55.381Z","avatar_url":"https://github.com/workleap.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wl-openapi-typescript\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)\n[![CI](https://github.com/gsoft-inc/wl-openapi-typescript/actions/workflows/ci.yml/badge.svg)](https://github.com/gsoft-inc/wl-openapi-typescript/actions/workflows/ci.yml)\n\nTools to generate TypeScript schemas from OpenAPI. It leverage [openapi-typescript](https://github.com/drwpow/openapi-typescript) and re-export types in a more user friendly way.\n\n## Packages\n\n| Package                 | Version                                                                                                                                     |\n|-------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------|\n| [@workleap/create-schemas](https://www.npmjs.org/package/@workleap/create-schemas)| [![NPM Version](http://img.shields.io/npm/v/@workleap/create-schemas.svg?style=flat)](https://www.npmjs.org/package/@workleap/create-schemas) |\n\n\n\n## Usages\n\nAdd a script in package.json to call `@workleap/create-schemas`\n\n```json\n  \"scripts\": {\n    \"create-schemas\": \"create-schemas [path_or_public_url_to_openapi_document] -o [output_path] [optional_addition_flags]\"\n  },\n  \"devDependencies\": {\n    \"@workleap/create-schemas\": \"0.1.0\"\n  }\n```\n\nIt is also fowarding all the [flags of openapi-typescript](https://openapi-ts.pages.dev/cli#flags) for more customization. Note that not all flags are supported correctly.\n\nIf you plan to lookup paths with route parameters we recommend using the `--path-params-as-types` flag\n\n### Example\n\nGiven this OpenAPI document:\n\n```yaml\nopenapi: 3.0.1\ninfo:\n  title: WebApi\n  version: '1.0'\npaths:\n  /good-vibes-points:\n    get:\n      tags:\n        - GoodVibesBank\n      summary: Get the current number of good vibe for a user\n      operationId: GetGoodVibesPoint\n      parameters:\n        - name: userId\n          in: query\n          required: true\n          schema:\n            type: string\n            format: uuid\n      responses:\n        '200':\n          description: Success\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/GetGoodVibePointsResult'\n        '400':\n          description: Bad Request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ProblemDetails'\ncomponents:\n  schemas:\n    GetGoodVibePointsResult:\n      required:\n        - point\n      type: object\n      properties:\n        point:\n          type: integer\n          format: int32\n      additionalProperties: false\n    ProblemDetails:\n      type: object\n      properties:\n        type:\n          type: string\n          nullable: true\n        title:\n          type: string\n          nullable: true\n        status:\n          type: integer\n          format: int32\n          nullable: true\n        detail:\n          type: string\n          nullable: true\n        instance:\n          type: string\n          nullable: true\n      additionalProperties: { }\n```\n\nIt will generate this schema file:\n\n```ts\n// From openapi-typescript\nexport interface paths {\n    \"/good-vibes-points\": {\n        parameters: {\n            query?: never;\n            header?: never;\n            path?: never;\n            cookie?: never;\n        };\n        /** Get the current number of good vibe for a user */\n        get: operations[\"GetGoodVibesPoint\"];\n        put?: never;\n        post?: never;\n        delete?: never;\n        options?: never;\n        head?: never;\n        patch?: never;\n        trace?: never;\n    };\n}\nexport type webhooks = Record\u003cstring, never\u003e;\nexport interface components {\n    schemas: {\n        GetGoodVibePointsResult: {\n            /** Format: int32 */\n            point: number;\n        };\n        ProblemDetails: {\n            type?: string | null;\n            title?: string | null;\n            /** Format: int32 */\n            status?: number | null;\n            detail?: string | null;\n            instance?: string | null;\n            [key: string]: unknown;\n        };\n    };\n    responses: never;\n    parameters: never;\n    requestBodies: never;\n    headers: never;\n    pathItems: never;\n}\nexport type $defs = Record\u003cstring, never\u003e;\nexport interface operations {\n    GetGoodVibesPoint: {\n        parameters: {\n            query: {\n                userId: string;\n            };\n            header?: never;\n            path?: never;\n            cookie?: never;\n        };\n        requestBody?: never;\n        responses: {\n            /** @description Success */\n            200: {\n                headers: {\n                    [name: string]: unknown;\n                };\n                content: {\n                    \"application/json\": components[\"schemas\"][\"GetGoodVibePointsResult\"];\n                };\n            };\n            /** @description Bad Request */\n            400: {\n                headers: {\n                    [name: string]: unknown;\n                };\n                content: {\n                    \"application/json\": components[\"schemas\"][\"ProblemDetails\"];\n                };\n            };\n        };\n    };\n}\n\n// From wl-openapi-typescript\nexport type GetGoodVibePointsResult = components[\"schemas\"][\"GetGoodVibePointsResult\"];\nexport type ProblemDetails = components[\"schemas\"][\"ProblemDetails\"];\n\nexport type Endpoints = keyof paths;\n```\n\nFor more details on how to use see [openapi-typescript documentation](https://openapi-ts.pages.dev/introduction)\n\n## Documentation\n\nFor documentations, please visit [our website](https://gsoft-inc.github.io/wl-openapi-typescript/).\n\nThe documentation is automatically generated on each release from the files in the docs directory.\n\n\n## 🤝 Contributing\n\nView the [contributor's documentation](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fwl-openapi-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkleap%2Fwl-openapi-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fwl-openapi-typescript/lists"}