elements
elements copied to clipboard
Omit empty and optional values in form data in Try It
Describe the bug
I have an API that manages differently empty values and omitted values. If I use form Data, I cannot omit a value from the requestBody, I am forced to send empty values.
To Reproduce
Given this OpenAPI document :
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
nick:
type: string
The curl sent would always be : curl -X POST "address" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "name=vaclav&nick="
But I should have a way to send : curl -X POST "address" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "name=vaclav"
Expected behavior
We should have a way to mark a field as optional in formData