redux-toolkit
redux-toolkit copied to clipboard
Code generation multiple output files not working for every endpoint
Config as per documentation:
const config: ConfigFile = {
schemaFile: 'https://petstore3.swagger.io/api/v3/openapi.json',
apiFile: './src/store/emptyApi.ts',
outputFiles: {
'./src/store/user.ts': {
filterEndpoints: [/user/i],
},
'./src/store/store.ts': {
filterEndpoints: [/store/i],
},
'./src/store/pet.ts': {
filterEndpoints: [/pet/i],
},
},
}
Note that instead of using /order I would like to use the path /store (which contains order and inventory in the demo).
In this case the endpoints for /store are not generated (user and pet works)
It's matching the operation name, not the url.
See here: https://github.com/reduxjs/redux-toolkit/blob/78781fd33930be2081a16ec6335b0c33c07ee03a/packages/rtk-query-codegen-openapi/src/generate.ts#L59-L66
So far we don't have any functionality to match by url.