redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Code generation multiple output files not working for every endpoint

Open pastinepolenta opened this issue 2 months ago • 1 comments

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)

pastinepolenta avatar Oct 31 '25 12:10 pastinepolenta

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.

phryneas avatar Nov 02 '25 21:11 phryneas