Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust snake case regex #3785

Merged
merged 2 commits into from Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rtk-query-codegen-openapi/src/generate.ts
Expand Up @@ -259,7 +259,7 @@ export async function generateApi(
const allNames = parameters.map((p) => p.name);
const queryArg: QueryArgDefinitions = {};
for (const param of parameters) {
const isPureSnakeCase = /^[a-zA-Z][\\w]*$/.test(param.name);
const isPureSnakeCase = /^[a-zA-Z][\w]*$/.test(param.name);
const camelCaseName = camelCase(param.name);

const name = isPureSnakeCase && !allNames.includes(camelCaseName) ? camelCaseName : param.name;
Expand Down
Expand Up @@ -1005,7 +1005,7 @@ const injectedRtkApi = api
overrideExisting: false,
});
export { injectedRtkApi as enhancedApi };
export type GetStructureDefinitionApiResponse = unknown;
export type GetStructureDefinitionApiResponse = /** status 200 Success */ FhirJsonResource;
export type GetStructureDefinitionApiArg = {
/** Some description */
foo?: any;
Expand All @@ -1024,6 +1024,7 @@ export type GetStructureDefinitionApiArg = {
/** Some description */
naming_conflict?: any;
};
export type FhirJsonResource = object;
export const { useGetStructureDefinitionQuery } = injectedRtkApi;

`;
Expand Down