Skip to content

Commit

Permalink
fix: revert e340527 - removed forced renaming query params to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
nicky1038 committed Apr 19, 2024
1 parent 2b6db23 commit 6a3c159
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/schema-routes/schema-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/dot-path-params/expected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
reproFunc: (
truckId: string,
query: {
queryId: string;
"query.id": string;
},
params: RequestParams = {},
) =>
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/dot-path-params/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
reproFunc: (
truckId: string,
query: {
queryId: string;
"query.id": string;
},
params: RequestParams = {},
) =>
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/sortTypes-false/expected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1993,9 +1993,9 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
data: Events,
query?: {
queryParam1?: number;
fooBarBaz?: number;
"foo.bar.baz"?: number;
queryParam2?: number;
queryParamBar3?: number;
"query.param.bar.3"?: number;
queryParam3?: string[];
},
params: RequestParams = {},
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/sortTypes-false/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1993,9 +1993,9 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
data: Events,
query?: {
queryParam1?: number;
fooBarBaz?: number;
"foo.bar.baz"?: number;
queryParam2?: number;
queryParamBar3?: number;
"query.param.bar.3"?: number;
queryParam3?: string[];
},
params: RequestParams = {},
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/sortTypes/expected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,11 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
someOp1: (
data: Events,
query?: {
"foo.bar.baz"?: number;
"query.param.bar.3"?: number;
queryParam1?: number;
queryParam2?: number;
queryParam3?: string[];
queryParamBar3?: number;
fooBarBaz?: number;
},
params: RequestParams = {},
) =>
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/sortTypes/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,11 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
someOp1: (
data: Events,
query?: {
"foo.bar.baz"?: number;
"query.param.bar.3"?: number;
queryParam1?: number;
queryParam2?: number;
queryParam3?: string[];
queryParamBar3?: number;
fooBarBaz?: number;
},
params: RequestParams = {},
) =>
Expand Down

0 comments on commit 6a3c159

Please sign in to comment.