swagger-api / swagger-api/swagger-ui
Parameters using content becomes string when sending array of integer
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Windows
- Browser: Chrome
- Version: 115.0.5790.111
- Method of installation: N/A
- Swagger-UI version: N/A
- Swagger/OpenAPI version: Swagger 2.0, OpenAPI 3.0
Content & configuration
Swagger/OpenAPI definition:
openapi: 3.0.1
info:
title: v1
version: v1
servers:
- url: 'http://localhost:62242'
paths:
/helloworld:
get:
parameters:
- in: query
name: id
description: id value
required: true
content:
application/json:
schema:
type: array
default: [834,839]
items:
type: integer
format: int32
example: 123
responses:
'200':
description: Success
content:
text/json:
schema:
type: string
example: "123"
application/json:
schema:
type: string
examples:
x:
value: "132"
'400':
description: Success
content:
text/json:
schema:
type: string
example: 123
application/json:
schema:
type: string
examples:
xy:
value: 132
?yourQueryStringConfig
id=[834,456]
### Screenshots

### How can we help?
using the try it function and change one default parameter from 839 to 456
Request URL shows:
http://localhost:62242/helloworld?id=%5B834%2C%22456%22%5D
by url decode it , the request is
http://localhost:62242/helloworld?id=[834,**"456"**]
We defined the parameters as an array of integer and tried to catch the serialized json string.
If the parameters are manually entered, the value will be quoted as string.
Is there a way to bypass the string convertsion?
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 with the Swagger/OpenAPI definition and the Try It request flow described in the issue, focusing on serialization of the query parameter after editing a default array value. Reproduce the request with [834,456] and verify that the generated URL preserves both values as integers rather than quoting the edited value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100