From ed4a65a2d0033bd348197a30ad69b3f4e0733edd Mon Sep 17 00:00:00 2001 From: Nikolay Kudryavtsev Date: Fri, 19 Apr 2024 22:13:40 +0200 Subject: [PATCH] fix: revert e340527 - removed forced renaming query params to camelCase --- src/schema-routes/schema-routes.js | 11 +---------- .../dot-path-params/__snapshots__/basic.test.ts.snap | 2 +- .../sortTypes-false/__snapshots__/basic.test.ts.snap | 4 ++-- tests/spec/sortTypes/__snapshots__/basic.test.ts.snap | 4 ++-- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/schema-routes/schema-routes.js b/src/schema-routes/schema-routes.js index 81a73a8f..7d17f623 100644 --- a/src/schema-routes/schema-routes.js +++ b/src/schema-routes/schema-routes.js @@ -10,7 +10,6 @@ const { RESERVED_PATH_ARG_NAMES, RESERVED_QUERY_ARG_NAMES, } = require("../constants.js"); -const { camelCase } = require("lodash"); const CONTENT_KIND = { JSON: "JSON", @@ -543,21 +542,13 @@ class SchemaRoutes { (objectSchema, schemaPart) => { if (!schemaPart || !schemaPart.name) return objectSchema; - let usageName = `${schemaPart.name}`; - - if (usageName.includes(".")) { - usageName = 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 e4aad5ec..2b7f7622 100644 --- a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap @@ -240,7 +240,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 00daa650..71f94feb 100644 --- a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap @@ -1995,10 +1995,10 @@ export class Api extends HttpClient extends HttpClient