Auto generated examples do not work with exploded array type
Open
Nobody has claimed this yet.
Type: Bug
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
This specification:
- in: query
name: my_param
schema:
type: array
items:
type: string
example:
- one
- two
explode: true
style: form
correctly yields
| my_param | Array of strings Example: my_param=one&my_param=two |
under 'Query Parameters'.
However, in the auto-generated examples we get for example (in Python):
query = {
"my_param": "my_param=one&my_param=two",
}
response = requests.get(url, params=query)
which does not produce a request containing my_param=one&my_param=two as url parameters.
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.
Research direction
Start by tracing the auto-generated Python example path for OpenAPI query parameters, using the exploded array specification and its generated Query Parameters table as the reproduction case. Compare how the example builds request parameters with the documented repeated-key form; done when the generated Python request produces separate my_param=one and my_param=two query parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100