{"repo":"fabien0102/openapi-codegen","free":true,"listed":false,"github":"https://github.com/fabien0102/openapi-codegen","clone":"git clone https://github.com/fabien0102/openapi-codegen.git","description":"A tool for generating code base on an OpenAPI schema.","language":"TypeScript","stars":632,"topics":["codegenerator","openapi","openapi3","typescript","openapi-cli","openapi-codegen","swagger","swagger-codegen"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"Tooling to give you full type-safety around OpenAPI specs. You can generate - TypeScript types - Type-safe Generic Fetchers - Type-safe React Query hooks (https://github.com/tanstack/query) Getting started 1. Initialize the generator If you wish to change any of the selections made, you can do so in the generated openapi-codegen.config.ts file later.. 2. Start Generation After the code generation is done, you will notice the following files: - {namespace}Fetcher.ts - defines a function that will make requests to your API. - {namespace}Context.tsx - the context that provides {namespace}Fetcher to other components. - {namespace}Components.tsx - generated React Query components (if you selected React Query as part of initialization). - {namespace}Schemas.ts - the generated Typescript types from the provided Open API schemas. &nbsp; Warning If {namespace}Fetcher.ts or {namespace}Context.tsx already exist in the output folder, they will not be replaced. However, {namespace}Components.tsx and {namespace}Schemas.ts will be re-generated each time based on the Open API spec file provided. 3. Configure the Fetcher (optional) After the first step you should see a file called {namespace}Fetcher.ts in your ouput directory. By default it uses the built-in Fetch API, you are free to change this to your fetching library of choice (Axios, Got etc.) If your Open API spec contains a configured server, then the base URL for all requests will default to that server's URL. If no such configuration","default_branch":null,"files":null,"tree":[],"storefront":"/r/fabien0102","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/fabien0102/openapi-codegen/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}