@rtk-query/codegen-openapi code: Ignore /api prefix for naming
Our API endpoints are prefixed with /api.
Would be nice to be able to ignore this prefix in the config.
Current result:
getApiUser: build.query<GetApiUserApiResponse, GetApiUserApiArg>({ query: () => ({ url: '/api/user' }) })
Desired result:
getUser: build.query<GetUserApiResponse, GetUserApiArg>({ query: () => ({ url: '/api/user' }) })
is there any workaround for this? for me it is the v1
getV1Development: build.query<GetV1DevelopmentApiResponse, GetV1DevelopmentApiArg>({ query: (queryArg) => ({ url: '/v1/development', params: { name: queryArg.name, companyName: queryArg.companyName } }), }),
is there any workaround for this? for me it is the v1
`getV1Development: build.query<GetV1DevelopmentApiResponse, GetV1DevelopmentApiArg>({
query: (queryArg) => ({ url: '/v1/development', params: { name: queryArg.name, companyName: queryArg.companyName } }), }),`
My current workaround is a shellscript that used the sed command to remove the prefix from the JSON. Which isn't clean, but it works for now. You also have to then in the same shellscript fetch the swagger json file before you remove the prefix and reference the file not the url in your RTK config.
Being able to pass an endpointNameOverride function in the config would be amazing.