From 6a3c159a988b9b6ea40cad8d4387f12c3e632aee 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 +---------- tests/spec/dot-path-params/expected.ts | 2 +- tests/spec/dot-path-params/schema.ts | 2 +- tests/spec/sortTypes-false/expected.ts | 4 ++-- tests/spec/sortTypes-false/schema.ts | 4 ++-- tests/spec/sortTypes/expected.ts | 4 ++-- tests/spec/sortTypes/schema.ts | 4 ++-- 7 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/schema-routes/schema-routes.js b/src/schema-routes/schema-routes.js index 365f2328..8fd89628 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/expected.ts b/tests/spec/dot-path-params/expected.ts index ee03aac9..72bb654a 100644 --- a/tests/spec/dot-path-params/expected.ts +++ b/tests/spec/dot-path-params/expected.ts @@ -237,7 +237,7 @@ export class Api extends HttpClient diff --git a/tests/spec/dot-path-params/schema.ts b/tests/spec/dot-path-params/schema.ts index ee03aac9..72bb654a 100644 --- a/tests/spec/dot-path-params/schema.ts +++ b/tests/spec/dot-path-params/schema.ts @@ -237,7 +237,7 @@ export class Api extends HttpClient diff --git a/tests/spec/sortTypes-false/expected.ts b/tests/spec/sortTypes-false/expected.ts index 17f43d62..3198d8ad 100644 --- a/tests/spec/sortTypes-false/expected.ts +++ b/tests/spec/sortTypes-false/expected.ts @@ -1993,9 +1993,9 @@ export class Api extends HttpClient extends HttpClient extends HttpClient diff --git a/tests/spec/sortTypes/schema.ts b/tests/spec/sortTypes/schema.ts index 10eb562a..8e9fd137 100644 --- a/tests/spec/sortTypes/schema.ts +++ b/tests/spec/sortTypes/schema.ts @@ -1992,11 +1992,11 @@ export class Api extends HttpClient