acacode / acacode/swagger-typescript-api
Array-type query params are always exploded
- 主要語言
- TypeScript
- 星號
- 4.1k
- 分支
- 436
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Apologies if I'm missing something obvious, but I'm seeing something unexpected with our generated fetch client.
Our backend API does not support exploded array query params (the Swagger specs specify `explode: false`) but it looks like the HTTP client does nothing to support the unexploded style, it just maps the values and joins them https://github.com/acacode/swagger-typescript-api/blob/main/templates/base/http-clients/fetch-http-client.ejs#L85
I didn't find an obvious config option that would change this behaviour, other than overriding the template or class method, which I was hoping to avoid.
There was an old issue where someone was having the opposite problem, and it looks like the fix applied there actually abandoned any OOTB support the unexploded style https://github.com/acacode/swagger-typescript-api/issues/222
Perhaps this is by design - I'm happy work around it for our project, but since I couldn't find any concrete docs/answers I think it's worth asking, and maybe should be called out that param schemas using `explode` have no support/effect on the generated client.
**Example:**
```openapi
paths:
/some/api/path:
get:
parameters:
- name: test
in: query
style: form
explode: false
schema:
type: array
items:
type: string
enum:
- hello
- world
- yay
```
**Expected request URL:**
`GET /some/api/path?test=hello,yay`
**Actual request URL:**
`GET /some/api/path?test=hello&test=yay`
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。