diff --git a/.changeset/rude-impalas-unite.md b/.changeset/rude-impalas-unite.md new file mode 100644 index 00000000..741b58d6 --- /dev/null +++ b/.changeset/rude-impalas-unite.md @@ -0,0 +1,5 @@ +--- +"swagger-typescript-api": patch +--- + +Remove unnecessary camel case conversion for query params. diff --git a/src/schema-routes/schema-routes.ts b/src/schema-routes/schema-routes.ts index 9ad60254..d53b72f2 100644 --- a/src/schema-routes/schema-routes.ts +++ b/src/schema-routes/schema-routes.ts @@ -512,21 +512,13 @@ export class SchemaRoutes { (objectSchema, schemaPart) => { if (!schemaPart || !schemaPart.name) return objectSchema; - let usageName = `${schemaPart.name}`; - - if (usageName.includes(".")) { - usageName = lodash.camelCase(usageName); - } - return { ...objectSchema, properties: { ...objectSchema.properties, - [usageName]: { + [schemaPart.name]: { ...schemaPart, ...(schemaPart.schema || {}), - $origName: schemaPart.name, - name: usageName, }, }, }; diff --git a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap index 23585efa..6d14845d 100644 --- a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap @@ -241,7 +241,7 @@ export class Api extends HttpClient diff --git a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap index 9c330066..9ea980ba 100644 --- a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap @@ -1997,9 +1997,9 @@ export class Api extends HttpClient extends HttpClient