acacode / acacode/swagger-typescript-api

incorrect nested query params serialization

Aberta
#464 4 comentários 12 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
TypeScript
Estrelas
4.1k
Forks
436
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.