acacode / acacode/swagger-typescript-api

incorrect nested query params serialization

Aperta
#464 4 commenti 12 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
TypeScript
Stelle
4.1k
Fork
436
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.