Submitting Array in requestBody with "application/x-www-form-urlencoded" ignores the explode encoding parameter
See original GitHub issueI am attaching an example where explode is set to true in both the parameter block and the requestBody and they behave differently.
The example midway down this page mentions that you can specify the explode param in the encoding block for the requestBody - https://swagger.io/docs/specification/describing-request-body/
I’m using that exact example, except setting explode to true.
{
"openapi" : "3.0.0",
"info" : {
"version" : "1.0.0",
"title" : "Swagger Petstore",
"license" : {
"name" : "MIT"
}
},
"servers" : [ {
"url" : "http://petstore.swagger.io/v1"
} ],
"paths" : {
"/pets" : {
"post" : {
"summary" : "Create a pet",
"operationId" : "createPets",
"tags" : [ "pets" ],
"parameters" : [
{
"name" : "limit",
"in" : "query",
"description" : "How many items to return at one time (max 100)",
"required" : false,
"schema" : {
"type" : "array",
"items" : {
"type": "string"
}
},
"style": "form",
"explode": true
}
],
"requestBody" : {
"content" : {
"application/x-www-form-urlencoded" : {
"schema" : {
"type" : "object",
"properties" : {
"color" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
},
"encoding" : {
"color" : {
"style" : "form",
"explode" : true
}
}
}
}
},
"responses" : {
"201" : {
"description" : "Null response"
}
}
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Encoding not exploding a property in requestBody in swagger-ui
There's currently no way to define your scenario (a multipart request with an exploded array) with OpenAPI, because the explode and style ...
Read more >explode - Manual - PHP
Returns an array of strings created by splitting the string parameter on boundaries formed by the separator . If separator is an empty...
Read more >WhatsNew 1.3 | Ktor Framework
Customize HttpCache behavior, serve stale if host is down, ignore max-age ... Headers use encoding different from other major HTTP clients ...
Read more >PHP Explode – How to Split a String into an Array
The explode() function takes in three parameters: the separator; the string to convert to an array; and the limit. The full syntax looks...
Read more >Pyspark - Split multiple array columns into rows - GeeksforGeeks
functions module. Syntax: pyspark.sql.functions.explode(col). Parameters: col is an array column ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@xyfantis nothing yet!
@shockey any update on this?