elements icon indicating copy to clipboard operation
elements copied to clipboard

Omit empty and optional values in form data in Try It

Open GeliXav opened this issue 4 years ago • 0 comments

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

GeliXav avatar Oct 28 '21 08:10 GeliXav