# It does not seem like setting a header in a response as required makes any difference

**URL:** <https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273>\
**Category:** Swagger\
**Tags:** api, migrated, swaggerhub\
**Created:** [March 5, 2025, 2:56pm UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273 "2025-03-05T14:56:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 5, 2025, 2:56pm UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/1 "2025-03-05T14:56:05Z")

</div>

> Originally posted by **HenrikHL** on March 05, 2025

I would expect a little red `\*` to appear next to the header-name when I specify the header as a required-header.

Here is an example

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/db29fac911a7cfc4476259f7c3a7f82122c59da3.png)

As can be seen - no required “red star” next to the `API Version` header.

Is this a bug or just not possible? (According to the schema of a header it should be possible)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 6, 2025, 10:41am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/2 "2025-03-06T10:41:14Z")

</div>

> Originally posted by **Tom\_S** on March 06, 2025

Hello HenrikHL,

Required fields are visually marked with a red asterisk (\*) in the **Query Parameters** section to ensure users provide necessary inputs during requests.

However, for headers, even though they can be defined as required (required: true), Swagger UI does not display a red asterisk or similar indicator for them. This is by design and not an issue with the tool. The required header will still be enforced during validation.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 6, 2025, 11:22am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/3 "2025-03-06T11:22:49Z")

</div>

> Originally posted by **HenrikHL** on March 06, 2025

Hi Tom\_S ,

Thank you for the prompt reply 🙂

When you write:

> However, for headers, even though they can be defined as required (required: true), Swagger UI does not display a red asterisk or similar indicator for them. This is by design and not an issue with the tool. The required header will still be enforced during validation.

I assume you mean required fields on headers in **responses** - because it works fine for headers in requests:

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/0f683689665c6de2e9ff12ab6c4026c8f129c55c.png)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [April 1, 2025, 7:32am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/4 "2025-04-01T07:32:11Z")

</div>

> Originally posted by **Tom\_S** on April 01, 2025

Hi Henrik, yes, you’re correct. The red asterix is displayed for headers in requests, as this field is required by the user of the API to fill in when sending a request.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [April 1, 2025, 9:54am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/5 "2025-04-01T09:54:43Z")

</div>

> Originally posted by **Tom\_S** on April 01, 2025

After consulting with our product team, we found that this use case may not have been considered in the past. We’re aware that SwaggerUI might also act as a documentation tool for server developers.

This seems like a good idea for a feature request. Thank you for bringing this to our attention.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [April 2, 2025, 8:29am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/6 "2025-04-02T08:29:39Z")

</div>

> Originally posted by **HenrikDCSA** on April 02, 2025

Thank you Tom\_S

In our case we are a standardization organization - so both sides need to comply (supplier and consumer). We don’t implement any of our APIs…

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [April 3, 2025, 9:49am UTC](https://community.smartbear.com/t/it-does-not-seem-like-setting-a-header-in-a-response-as-required-makes-any-difference/273/7 "2025-04-03T09:49:23Z")

</div>

> Originally posted by **Tom\_S** on April 03, 2025

Understood. We will consider your example for discussion about further improvements to the editor and the visual representation of responses.

We appreciate you bringing this to our attention, as it helps us better understand the needs of users using our product!
