{"id":24655035,"url":"https://github.com/balisecode/swaggerclientgenerator","last_synced_at":"2026-04-13T21:02:18.246Z","repository":{"id":154452346,"uuid":"631644257","full_name":"BaliseCode/SwaggerClientGenerator","owner":"BaliseCode","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-15T18:53:47.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T04:12:06.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/BaliseCode.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}},"created_at":"2023-04-23T17:09:01.000Z","updated_at":"2023-06-15T18:53:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"21628d6c-997c-4f3a-83b2-2a5755673fe9","html_url":"https://github.com/BaliseCode/SwaggerClientGenerator","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/BaliseCode%2FSwaggerClientGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaliseCode%2FSwaggerClientGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaliseCode%2FSwaggerClientGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaliseCode%2FSwaggerClientGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaliseCode","download_url":"https://codeload.github.com/BaliseCode/SwaggerClientGenerator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722747,"owners_count":20499154,"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":"2025-01-25T22:35:57.366Z","updated_at":"2026-04-13T21:02:13.202Z","avatar_url":"https://github.com/BaliseCode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nSwagger Client Generator is a tool that enables developers to easily parse Swagger API specification files and generate code bindings that are type safe using the popular validation library Zod and the flexible HTTP client Wretch. Swagger Client Generator makes it easy to generate high-quality code that is both scalable and maintainable. \n\n# Generate your API client\n\n## Installation\n\n\n    npm install @balise/swagger-client-generator\n\nThe following code explains how to generate code bindings from a swagger.json file.\n\n    import SwaggerGenerateClient from \"@balise/swagger-client-generator\";\n\n    let Query = new SwaggerGenerateClient('inputfile.json', 'outputfile.ts');\n\n## Integrate with Vite \n\nTodo\n\n\n# Use the API client\n\n## Instanciate the API\nTo use the Api you can add the following code to your application to instanciate a caller. That will create a Call object that you can use to call your API.\n\n    import ApiCallerInstance from \"./outputfile\";\n\n    const Call = new ApiCallerInstance({\n        rootUrl: 'https://localhost:3000',\n        headers: {\n            'Bearer: 'SomeToken'\n        }\n    }).ApiCall;\n\n\n## Make an API Call\nNext when you need to call the API you can use the following pattern\n\n    let u = {\n        first_name: \"James\", \n        last_name: \"Bond\"\n    }\n\n    Call.Projets.Users.post(u).then((res) =\u003e {\n        console.log(res)\n    }).catch((err) =\u003e {\n        console.error(err)\n    });\n\nthe *u* object will be validated trough the Zod library, and wrech will make a post request at the *https://localhost:3000/Projets/Users* endpoint using the bearer token from the setup\n\n#Types\nThe Library also generates and exports Types and Validators from schemas from the Swagger file. \n\nFor the Project schema, ProjectValidator is a Zod validator and ProjectType is a type infered from this validator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalisecode%2Fswaggerclientgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalisecode%2Fswaggerclientgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalisecode%2Fswaggerclientgenerator/lists"}