In my API I use a variation of camel casing that preserves uppercase in abbreviations. For example, userId becomes userID. Normally this is interpreted as camel case and I would not expect any transformations to be applied to the string.
The issue is that RTK-Query Codegen uses the lodash camelCase function, which converts userID to userId. Lodash's behavior in this regard has been controversial (see https://github.com/lodash/lodash/issues/5045) and I think it would be better to use an alternative (like hump) which has the expected behavior.
This is happening for us as well. Our generated types are all in camelCase but our models are in PascalCase so this is making it hard to actually use the generated types.
In my API I use a variation of camel casing that preserves uppercase in abbreviations. For example,
userId
becomesuserID
. Normally this is interpreted as camel case and I would not expect any transformations to be applied to the string.The issue is that RTK-Query Codegen uses the lodash
camelCase
function, which convertsuserID
touserId
. Lodash's behavior in this regard has been controversial (see https://github.com/lodash/lodash/issues/5045) and I think it would be better to use an alternative (like hump) which has the expected behavior.Relevant code:
https://github.com/reduxjs/redux-toolkit/blob/2bb44b97dc290b70e3ef2502c743c9e90520fe50/packages/rtk-query-codegen-openapi/src/generate.ts#L218-L221