-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
Description
Q&A (please complete the following information)
- OS: ubuntu
- Browser: chrome
- Version: 71.0.3578.98 (Official Build) (64-bit)
- Method of installation: composer
- Swagger-UI version: 3.18.3
- Swagger/OpenAPI version: OpenApi 3.0
Content & configuration
Swagger/OpenAPI definition:
paths:
/match/started:
post:
tags:
- match
summary: 'Callback for when a game has started.'
operationId: 'App\Http\Controllers\Api\V1\MatchController::started'
requestBody:
description: 'Something something batman!'
required: true
content:
multipart/form-data:
schema:
required:
- match_uuid
properties:
game_uuid:
type: string
'player_uuids[]':
type: array
items:
type: string
type: object
encoding:
'player_uuids[]':
style: form
explode: true
responses:
200:
description: 'success response'
content:
application/json:
schema:
$ref: '#/components/schemas/Api_V1_Match_Started'
Swagger-UI configuration options:
const ui = SwaggerUIBundle({
dom_id: '#swagger-ui',
url: "http://matchmaking.test/docs/api-docs.json",
operationsSorter: null,
configUrl: null,
validatorUrl: null,
oauth2RedirectUrl: "http://matchmaking.test/api/oauth2-callback",
requestInterceptor: function() {
this.headers['X-CSRF-TOKEN'] = '';
return this;h
},
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
Screenshots
How can we help?
Encoding is not exploding a array property in requestBody in swagger-ui.
Im getting this command for curl:
curl -X POST "https://editor.swagger.io/api/v1/match/started" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "game_uuid=test" -F "player_uuids[]=aaa,bbb,ccc"
notice this part:
-F "player_uuids=aaa,bbb,ccc"
im trying to get this result
-F "player_uuids[]=aaa" -F "player_uuids[]=bbb" -F "player_uuids[]=ccc"
emysa341, jtlz2 and carlosvega