Rapini is a CLI code generator that produces React Query (v3/v4/v5), SWR hooks, Axios requests, and TypeScript types from OpenAPI specifications. Current stable version is 3.5.4 with monthly releases. It differentiates itself by packaging the generated code as a publishable npm package, supporting multiple React data-fetching libraries, and offering query key generation. Compatible with OpenAPI 3.0 and Swagger 2.0.
npm install rapiniNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates a React Query v5 package from OpenAPI spec, then uses a typed hook in a React component to fetch data.
Ensure the matching version of React Query is installed (v3, v4, or v5).
Use `npx rapini react-query v5` instead of `npx rapini react-query` (which defaults to v3).
Validate your OpenAPI spec with tools like swagger-cli before generation.
Import using ES module syntax in your project.
npm install @tanstack/react-query
Fix the syntax of your openapi.yaml or openapi.json file
Ensure you are using `npx rapini` (lowercase) and clear npx cache: `npx clear-npx-cache`