Using dictionary in query param
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start by reproducing the provided OpenAPI query parameter with style deepObject and explode true using openapi-python-client 0.19.0, then trace the generated request's query serialization. Confirm the fix by checking that dictionary keys produce metadata[author] and metadata[publisher] in the URL, and add or update a regression test for this behavior.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 293
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openapi-generators/openapi-python-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
openapi-generators/openapi-python-client#1451 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
openapi-generators/openapi-python-client#1435 · 1 comment ·
All issues in openapi-generators/openapi-python-client
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·