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 Jun 19, 2024
1 parent 6a8ea36 commit ed4a65a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 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
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,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/__snapshots__/basic.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1995,10 +1995,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
someOp1: (
data: Events,
query?: {
"foo.bar.baz"?: number;
"query.param.bar.3"?: number;
queryParam1?: number;
fooBarBaz?: number;
queryParam2?: number;
queryParamBar3?: number;
queryParam3?: string[];
},
params: RequestParams = {},
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/sortTypes/__snapshots__/basic.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1995,11 +1995,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 ed4a65a

Please sign in to comment.