Using dictionary in query param
還沒有人認領這個 Issue。
評估
研究方向
首先使用 openapi-python-client 0.19.0,重現提供的具有 style deepObject 和 explode true 的 OpenAPI 查詢參數,然後追蹤產生之請求的查詢序列化過程。透過檢查字典鍵是否在 URL 中產生 metadata[author] 和 metadata[publisher] 來確認修正,並為此行為新增或更新回歸測試。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
I have an endpoint that takes in a dictionary as a query param:
- name: metadata
in: query
required: false
style: deepObject
explode: true
schema:
type: object
additionalProperties:
type: string
note this:
style: deepObject
explode: true
The openapi generator generates same code whether I have
style: deepObject
explode: true
present or not. I am using version 0.19.1.
The URL generated is like:
http://localhost:8080/foo?author=Joshua%20Bloch&publisher=Pearson%20Addison-Wesley
When
style: deepObject
explode: true
is present, the URL should be like:
http://localhost:8080/foo?metadata[author]=Joshua%20Bloch&metadata[publisher]=Pearson%20Addison-Wesley
refer: https://swagger.io/docs/specification/serialization/
OpenAPI Spec File
see above
Desktop (please complete the following information):
- OS: [e.g. macOS 10.15.1] macOS ventura (13)
- Python Version: [e.g. 3.8.0]
- openapi-python-client version [e.g. 0.1.0] 0.19.0
Additional context
Add any other context about the problem here.
- 主要語言
- Python
- 星號
- 2k
- 分支
- 293
- 平均合併
- 34 分鐘
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
openapi-generators/openapi-python-client 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 2/5 1-3 小時 新手友好度 65/100
-
難度 3/5 1-2 天 新手友好度 72/100
openapi-generators/openapi-python-client#1451 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 52/100
-
難度 3/5 1-2 天 新手友好度 64/100
openapi-generators/openapi-python-client#1435 · 1 則留言 ·
查看 openapi-generators/openapi-python-client 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
anthropics/skills#1811 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·