{"repo":"rametta/rapini","free":true,"listed":false,"github":"https://github.com/rametta/rapini","clone":"git clone https://github.com/rametta/rapini.git","description":":leafy_green: OpenAPI to React Query (or SWR) & Axios","language":"TypeScript","stars":178,"topics":["axios","codegen","generator","openapi","react-query","swagger","react","swr","tanstack-react-query","typescript"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":":leafy green: Rapini - OpenAPI to React Query (or SWR) & Axios Rapini is a tool that generates React Query (or SWR) hooks, Axios requests and Typescript types, based on an OpenAPI spec file. The generated code is packaged conveniently so that it can be published as a package on any NPM registry. Features - :bicyclist: Generates axios calls for every endpoint, with typed payload. - :golfing: Generates custom react hooks that use React Query's useQuery and useMutation hooks for each axios call. Optional to generate custom hooks that use SWR's useSWR hook. - :rowboat: Generates query keys for every hook. - :weight lifting: Generates strong typescript types for all inputs, outputs, and options. Getting Started Rapini is a CLI tool so you can execute the remote npm package directly for convenience eg: This will generate the package code based on an OpenAPI file at path/to/openapi.yaml . The outputted code will be packaged in a way to just publish it as your own NPM package and then import it in your React project. CLI Arguments & Options rapini help outputs the following: rapini help react-query outputs the following: rapini help swr outputs the following: Example Usage Let's say you have an OpenAPI file that looks like this one. Once you run the CLI tool to generate the React Query code, you can then cd into the generated directory, run npm install && npm run build then npm publish with your own package name to publish it to your own registry, then import and use it like this: Yo","default_branch":null,"files":null,"tree":[],"storefront":"/r/rametta","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rametta/rapini/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."}