acacode / acacode/swagger-typescript-api

incorrect nested query params serialization

未关闭
#464 4 条评论 12 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
TypeScript
星标
4.1k
派生
436
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

I'm using the 12.0.2

When an endpoint has a query param containing a nested object like this :

```yaml
- name: pageParams
in: query
required: false
explode: true
schema:
$ref: "common.yaml#/components/schemas/PaginatedRequestParams"
```
```yaml
PaginatedRequestParams:
description:
Page params to search the collection (this is an exploded object, so pass the inner properties directly)
type: object
properties:
limit:
description: Number of elements to retrieve
type: integer
default: 50
cursor:
description: Cursor from a previous search
type: string
format: base64
returnCount:
description: Set to 'true' to obtain the total count of the collection (use only when necessary, may be performance-costly)
type: boolean
default: false
```

The request query is serialized like this :
```
&pageParams=%5Bobject%20Object%5D
```

however the type seems ok :
```js
query?: {
...
pageParams?: PaginatedRequestParams;
},
```

Looking at the issue history, it seemed to be handled at a time but a reverted in this fix :
https://github.com/acacode/swagger-typescript-api/issues/228

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。