Skip to content

Optional header field when reset results in empty header value #4587

@shamis

Description

@shamis

Q&A (please complete the following information)

  • OS: any
  • Browser: any
  • Method of installation: npm
  • Swagger-UI version: 3.15.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

json config

Describe the bug you're encountering

Have a request with optional header /sql/ where once the header is set it works fine, but once it is reset to empty then an emtpy header is being sent every time.

To reproduce...

Steps to reproduce the behavior:

  1. Go to sql GET and execute query without header x-irest-conn (x-irest-conn is an optional header).
  2. Try a GET with a header value for x-irest-conn
  3. Remove the value for x-irest-conn the request now is executed with empty x-irest-conn
  4. -H "x-irest-conn: " this is seen in the curl command.
  5. Initial request works fine. Problem arises once the header field is reset to empty.

Expected behavior

When the header field is empty no header should be sent since it is configured as optional

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions