swagger-ui
swagger-ui copied to clipboard
Wrong encoding when omitted
Q&A (please complete the following information)
- OS: macOS]
- Browser: chrome
- Version: 96
- Method of installation: maven
- Swagger/OpenAPI version: Swagger 2.0, OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.0
info:
title: Test API
version: '1.0'
servers:
- url: 'http://localhost:3000'
paths:
/implicit-encoding:
post:
summary: Implicit encoding
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
numbers:
type: array
items:
format: int64
type: integer
responses:
'200':
description: OK
/explicit-encoding:
post:
summary: Explicit encoding
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
numbers:
type: array
items:
format: int64
type: integer
encoding:
numbers:
style: form
explode: true
responses:
'200':
description: OK
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
- Go to '/implicit-encoding'
- Click on 'try it out'
- Click on 'add integer item'
- Add two or more items
- Click on 'execute'
Expected behavior
The data of the curl command should be
-d 'numbers=1&numbers=2&numbers=3'
Actual behavior
The data of the curl command is
-d 'numbers=1,2,3'
Additional context or thoughts
The provided explicit-encoding endpoint works as expected.
Can confirm this is still an issue