{"id":27920225,"url":"https://github.com/nightmaregaurav/swagger-endpoints-gen","last_synced_at":"2025-10-10T23:46:21.712Z","repository":{"id":65143930,"uuid":"583527292","full_name":"nightmaregaurav/swagger-endpoints-gen","owner":"nightmaregaurav","description":"Auto generate typescript models and endpoints from swagger.json","archived":false,"fork":false,"pushed_at":"2024-01-10T16:38:29.000Z","size":107,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T20:55:51.516Z","etag":null,"topics":["api","api-integration","automate-swagger","developer-tool","developer-tools","endpoints-specification","interface-builder","models-generation","openapi-generator","swagger","swagger-codegen","swagger-model-generator","typescript","typescript-interface-generator","typescript-models"],"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/nightmaregaurav.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":"2022-12-30T03:30:27.000Z","updated_at":"2023-10-15T03:06:23.000Z","dependencies_parsed_at":"2025-05-06T20:13:16.934Z","dependency_job_id":"80a09630-43a3-41a4-8c4a-fefb1841190d","html_url":"https://github.com/nightmaregaurav/swagger-endpoints-gen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nightmaregaurav/swagger-endpoints-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightmaregaurav%2Fswagger-endpoints-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightmaregaurav%2Fswagger-endpoints-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightmaregaurav%2Fswagger-endpoints-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightmaregaurav%2Fswagger-endpoints-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nightmaregaurav","download_url":"https://codeload.github.com/nightmaregaurav/swagger-endpoints-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightmaregaurav%2Fswagger-endpoints-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005583,"owners_count":26083921,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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","api-integration","automate-swagger","developer-tool","developer-tools","endpoints-specification","interface-builder","models-generation","openapi-generator","swagger","swagger-codegen","swagger-model-generator","typescript","typescript-interface-generator","typescript-models"],"created_at":"2025-05-06T20:13:12.418Z","updated_at":"2025-10-10T23:46:21.699Z","avatar_url":"https://github.com/nightmaregaurav.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Swagger Endpoints Generator (Ts/Js)\n[![npm version](https://badge.fury.io/js/@nightmaregaurav%2Fswagger-endpoints-gen.svg)](https://badge.fury.io/js/@nightmaregaurav%2Fswagger-endpoints-gen)   [![HitCount](https://hits.dwyl.com/nightmaregaurav/swagger-endpoints-gen.svg?style=flat)](http://hits.dwyl.com/nightmaregaurav/swagger-endpoints-gen)\u003cbr\u003e\n[![NPM](https://nodei.co/npm/@nightmaregaurav/swagger-endpoints-gen.png?mini=true)](https://nodei.co/npm/@nightmaregaurav/swagger-endpoints-gen/)\n***\n### Description\nAutomatically generate typescript models and endpoints from `swagger.json` so api call is as simple as writing `endpoints.API__GET__my_object.call({data:value});`\n\n### Installation\nInstall swagger-endpoints-gen globally (Preferred)\n```bash\nnpm install -g @nightmaregaurav/swagger-endpoints-gen\n```\ninstall swagger-endpoints-gen locally as dev dependency\n```bash\nnpm install -D @nightmaregaurav/swagger-endpoints-gen\n````\n\n### Usage\n## For command line usage\nContents of `in.json`:\n```json\n[\n  {\n    \"outDir\": \"/path/to/output/folder1\",\n    \"baseUrl\": \"http://base.url.system\",\n    \"bearerTokenImportPath\": \"@/auth/authHelpers\",\n    \"successErrorMiddlewarePath\": \"@/middlewares/baseMiddlewares\",\n    \"cacheHelperPath\": \"@/helpers/cacheHelpers\",\n    \"swaggers\": [],\n    \"swaggerUrls\": [\"http://base.url.system/swagger/v1/swagger.json\"],\n    \"removeComments\": true\n  },\n  {\n    \"outDir\": \"/path/to/output/folder2\",\n    \"baseUrl\": \"http://base.url.system\",\n    \"bearerTokenImportPath\": \"@/auth/authHelpers\",\n    \"successErrorMiddlewarePath\": \"@/middlewares/baseMiddlewares\",\n    \"cacheHelperPath\": \"@/helpers/cacheHelpers\",\n    \"swaggers\": [],\n    \"swaggerUrls\": [\"http://base.url.system/swagger/v1/swagger2.json\"],\n    \"removeComments\": false\n  }\n]\n```\n\n``` bash\nnpx generate-endpoints-from-swagger in.json \n```\n## For programmatic usage\n```typescript\nimport { createEndpointsAndModels } from '@nightmaregaurav/swagger-endpoints-gen';\nimport swagger1 from './swagger1.json';\nimport swagger2 from './swagger2.json';\nimport swagger3 from './swagger3.json';\nimport swagger4 from './swagger4.json';\n\ncreateEndpointsAndModels({\n    outDir: \"./endpoints\",\n    bearerTokenImportPath: \"@/auth/authHelpers\",\n    successErrorMiddlewarePath: \"@/middlewares/baseMiddlewares\",\n    cacheHelperPath: \"@/helpers/cacheHelpers\",\n    baseUrl: \"https://api.example.com\",\n    swaggers: [swagger1, swagger2, swagger3, swagger4],\n    swaggerUrls: [\"https://api.example.com/swagger/v1/swagger.json\", \"https://api.example.com/swagger/v2/swagger.json\", \"https://api.example.com/swagger/v3/swagger.json\"],\n    \"removeComments\": true\n});\n```\n\n### Example usage of generated endpoints\n```typescript\nimport { endpoints } from './endpoints';\n\nlet userInfo: UserModel = await endpoints.API__GET__user__userId.call({userId: 1});\nlet userId: number = await endpoints.API__POST__user__schoolId.call({schoolId:2}, {data: {name: \"John Doe\"}});\n// rest of the codes\n```\n***\n## Technical Details\n* Language: Typescript\n \n## How to Contribute\n* Fork the repository\n* Clone the forked repository\n* Make changes\n* Commit and push the changes\n* Create a pull request\n* Wait for the pull request to be merged\n* Celebrate\n* Repeat\n\n*If you are new to open source, you can read [this](https://opensource.guide/how-to-contribute/) to learn how to contribute to open source projects.*\u003cbr\u003e\n*If you are new to GitHub, you can read [this](https://guides.github.com/activities/hello-world/) to learn how to use GitHub.*\u003cbr\u003e\n*If you are new to Git, you can read [this](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) to learn how to use Git.*\u003cbr\u003e\n*If you are new to TypeScript, you can read [this](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) to learn how to use TypeScript.*\u003cbr\u003e\n\n## License\nSwagger Endpoints Generator is released under the MIT License. You can find the full license details in the [LICENSE](LICENSE) file.\n\nMade with ❤️ by [NightmareGaurav](https://github.com/nightmaregaurav).\n\n---\nOpen For Contribution\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightmaregaurav%2Fswagger-endpoints-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightmaregaurav%2Fswagger-endpoints-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightmaregaurav%2Fswagger-endpoints-gen/lists"}