Skip to content

Query parameters with dots to camelCase #460

Closed as not planned
Closed as not planned
@angela-patino-yuli

Description

@angela-patino-yuli

Summary
A similar issue has been fixed for path parameters #413
Is it possible to have it for query params as well?
On my swagger.json file, If a query parameter has a dot in it (e.g. from.year) then swagger-typescript-api rewrites this to
"from.year"?: number; instead of "fromYear"

Expected

foobar = (
   query?: {
     /** @format int32 */
     "fromYear"?: number;
   },
   params: RequestParams = {},
 ) =>
   this.http.request<void, any>({
     path: `/api/list`,
     method: "GET",
     query: query,
     secure: true,
     ...params,
   });

Actual

 foobar = (
    query?: {
      /** @format int32 */
      "from.year"?: number;
    },
    params: RequestParams = {},
  ) =>
    this.http.request<void, any>({
      path: `/api/list`,
      method: "GET",
      query: query,
      secure: true,
      ...params,
    });

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions