-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(openApi): configured rtk-OpenApi codegen
- Loading branch information
1 parent
69f0704
commit 13aaa96
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ docs/gen | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
#API codegen files | ||
./src/store/LynxScannerApi.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { ConfigFile } from '@rtk-query/codegen-openapi' | ||
|
||
const config: ConfigFile = { | ||
schemaFile: './openapi.yaml', | ||
apiFile: './src/store/emptyApi.ts', | ||
apiImport: 'emptySplitApi', | ||
outputFile: './src/store/LynxScannerApi.ts', | ||
exportName: 'LynxScannerApi', | ||
hooks: true, | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Or from '@reduxjs/toolkit/query' if not using the auto-generated hooks | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' | ||
Check failure on line 2 in src/store/emptyApi.ts
|
||
|
||
// initialize an empty api service that we'll inject endpoints into later as needed | ||
export const emptySplitApi = createApi({ | ||
baseQuery: fetchBaseQuery({ baseUrl: '/' }), | ||
endpoints: () => ({}) | ||
}) |