{"id":23228010,"url":"https://github.com/barnuri/openapi-toolkit","last_synced_at":"2025-08-19T14:33:03.029Z","repository":{"id":41827879,"uuid":"316588971","full_name":"barnuri/openapi-toolkit","owner":"barnuri","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-14T20:56:41.000Z","size":1606,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T12:50:47.884Z","etag":null,"topics":["openapi","openapi3","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barnuri.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":"2020-11-27T19:56:53.000Z","updated_at":"2024-10-14T20:56:32.000Z","dependencies_parsed_at":"2024-04-18T09:31:54.769Z","dependency_job_id":"65eb7a03-b823-434e-aa15-f80e455ddd58","html_url":"https://github.com/barnuri/openapi-toolkit","commit_stats":{"total_commits":423,"total_committers":3,"mean_commits":141.0,"dds":"0.18439716312056742","last_synced_commit":"775cfecafd5c94e5c1cc3018b188c8006a8d1997"},"previous_names":["barnuri/openapi-definition-to-editor"],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnuri%2Fopenapi-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnuri%2Fopenapi-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnuri%2Fopenapi-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnuri%2Fopenapi-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barnuri","download_url":"https://codeload.github.com/barnuri/openapi-toolkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230151950,"owners_count":18181318,"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":["openapi","openapi3","swagger","typescript"],"created_at":"2024-12-19T01:11:28.789Z","updated_at":"2024-12-19T01:11:29.242Z","avatar_url":"https://github.com/barnuri.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi-toolkit\nopenapi-toolkit is an open-source tool designed to streamline the integration of OpenAPI (formerly known as Swagger) specifications into your development workflow. By taking an OpenAPI/Swagger file as input, the OpenAPI Toolkit automatically generates server and client code, enabling seamless integration of APIs. This automation accelerates development processes, ensures consistency across different platforms, and reduces the risk of manual errors. Whether you're building a new service or integrating with existing APIs, OpenAPI Toolkit simplifies the process by providing ready-to-use code tailored to your OpenAPI specifications.\n\n# Install\n\n[![Run Tests](https://github.com/barnuri/openapi-toolkit/actions/workflows/runTests.yaml/badge.svg)](https://github.com/barnuri/openapi-toolkit/actions/workflows/runTests.yaml) [![Create Tag And Release And Publish To NPM](https://github.com/barnuri/openapi-toolkit/actions/workflows/createTagAndReleaseAndPublish.yaml/badge.svg)](https://github.com/barnuri/openapi-toolkit/actions/workflows/createTagAndReleaseAndPublish.yaml)\n\n[NPM](https://www.npmjs.com/package/openapi-toolkit)\n\n```bash\nnpm i openapi-toolkit\n```\n\n# Auto Generate Client/Server (Cli)\n\n```bash\nnpm i -g openapi-toolkit\n\n# example\nopenapi-toolkit -i https://petstore3.swagger.io/api/v3/openapi.json -g typescript-axios -o ./src/services/petStore --modelNamePrefix My --modelNameSuffix .dto\n\n# show all options\nopenapi-toolkit -h\n\n# with docker\ndocker run --rm --name openapi-toolkit -v \"$(pwd)/output:/output\" -e CLI_PARAMS=\"-i https://petstore3.swagger.io/api/v3/openapi.json -g typescript-axios --modelNamePrefix My --modelNameSuffix .dto\" barnuri/openapi-toolkit\n```\n\n# Auto Generate Client/Server (JS\\TS)\n\n```js\nconst { multipleGenerate, generate } = require('openapi-toolkit');\n\n// use multipleGenerate when you want multiple outputs\n(async () =\u003e {\n    const sharedConfig = { debugLogs: false };\n    await multipleGenerate(`https://petstore3.swagger.io/api/v3/openapi.json`, [\n        { ...sharedConfig, generator: 'typescript-react-query', output: `./typescript-react-query/src` },\n        { ...sharedConfig, generator: 'typescript-axios', output: `./typescript-axios/src` },\n        { ...sharedConfig, generator: 'typescript-axios', output: `./typescript-models/src`, modelsOnly: true },\n        { ...sharedConfig, generator: 'c#', output: `./c#/src`, },\n        { ...sharedConfig, generator: 'go', output: `./go/src` },\n        { ...sharedConfig, generator: 'python', output: `./python/src` },\n    ]);\n})();\n\n// use generate when you want only one output\n(async () =\u003e {\n    await generate({ pathOrUrl: `https://petstore3.swagger.io/api/v3/openapi.json`, generator: 'typescript-react-query', output: `./typescript-react-query/src` });\n})();\n```\n\n### Help output\n\n```text\nopenapi-toolkit \u003ccommand\u003e, default command 'generate'\n\nCommands:\n  generate    auto generate proxy client from swagger file             [default]\n  generators  generators list\n  completion  generate completion script\n\nOptions:\n      --version                Show version number                     [boolean]\n  -h, --help                   Show help                               [boolean]\n  -i, --pathOrUrl              path or url for swagger file           [required]\n  -o, --output                 output path                            [required]\n  -g, --generator              generator name      [default: \"typescript-axios\"]\n  -t, --type                   [choices: \"client\", \"server\"] [default: \"client\"]\n  -n, --namespace                         [default: \"OpenapiDefinitionGenerate\"]\n      --modelsFolderName                                     [default: \"models\"]\n      --modelNamePrefix                                            [default: \"\"]\n      --modelNameSuffix                                            [default: \"\"]\n      --controllersFolderName                           [default: \"controllers\"]\n      --controllerNamePrefix                                       [default: \"\"]\n      --controllerNameSuffix                             [default: \"Controller\"]\n```\n\n## [Vscode Plugin For Auto Generate](https://marketplace.visualstudio.com/items?itemName=Bar.generator-from-swagger)\n\n\n# [Examples](./examples/ReadMe.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnuri%2Fopenapi-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarnuri%2Fopenapi-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnuri%2Fopenapi-toolkit/lists"}