Gathering detailed insights and metrics for @waiin/openapi-tools
Gathering detailed insights and metrics for @waiin/openapi-tools
Gathering detailed insights and metrics for @waiin/openapi-tools
Gathering detailed insights and metrics for @waiin/openapi-tools
npm install @waiin/openapi-tools
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
🔧 @waiin/openapi-tools is a powerful tool and library designed to streamline API development by generating proxy services and Redux integrations for React applications based on OpenAPI specifications. It supports any JSON from Swagger, allowing seamless API consumption with minimal effort.
✅ Automatically creates API service layers from OpenAPI specs.
✅ Supports RESTful API requests with built-in configurations.
✅ Reduces boilerplate code for API calls.
✅ Generates Redux slices and hooks for API state management.
✅ Provides seamless state management for API responses.
✅ Enables easy caching and refetching of data.
✅ Works with any JSON format from Swagger/OpenAPI.
✅ Parses OpenAPI definitions to generate type-safe API services.
✅ Allows modifications to generated services.
✅ Configurable templates for service generation.
✅ Simple CLI commands for API generation.
✅ Minimal configuration required for setup.
Install using npm:
1npm install @waiin/openapi-tools
package.json
1"scripts": { 2 "generate": "npx openapi-tools --source <local_path_or_url> --output <output_directory>" 3}
1"scripts": { 2 "generate": "npx openapi-tools --source D:/Waiin/controller-api/gen/http/openapi3.json --output src/middleware" 3}
1"scripts": { 2 "generate": "npx openapi-tools --source https://petstore3.swagger.io/api/v3/openapi.json --output src/middleware" 3}
1npm run generate
Generated API hooks and Redux slices allow easy integration:
1import { useEffect } from "react"; 2import { useDispatch, useSelector } from "react-redux"; 3import { listFindPetsByStatus, StatusEnum } from "./api/petService"; 4 5const App = () => { 6 const dispatch = useDispatch(); 7 const pets = useSelector((state: any) => state.petReducer); 8 9 useEffect(() => { 10 dispatch(listFindPetsByStatus(StatusEnum.Sold)); 11 }, [dispatch]); 12 13 return <div>{JSON.stringify(pets)}</div>; 14};
1 2const axiosInstance = axios.create({ baseURL: 'https://petstore3.swagger.io/api/v3' }); 3 4axiosInstance.interceptors.response.use( 5 (response) => response, 6 (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') 7); 8export const store = configureStore({ 9 reducer: CombineReducers, 10 middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(thunk, axiosMiddleware(axiosInstance)), 11}); 12export type RootStateType = ReturnType<typeof store.getState>; 13
🚀 Boost Productivity – Save time on writing API calls manually.
⚡ Seamless Redux Integration – Get auto-generated slices & hooks.
📖 Type-Safe Code – Ensures strong typing with OpenAPI.
🔧 Customizable & Scalable – Modify templates as per project needs.
🔥 Supercharge your API workflow today! Install and start using @waiin/openapi-tools
now. 🚀
No vulnerabilities found.
No security vulnerabilities found.