Azure / Azure/azure-functions-openapi-extension

Bug report, feature request or other request

Open
#601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

**Describe the issue**
In the [OpenApiParameter], even if we pass required="true", it doesn't seems to be working.

sample:- `[OpenApiParameter(RequestHeaders.corelationID, In = ParameterLocation.Header, Required = true)]`

**To Reproduce**
Steps to reproduce the behavior:
1. Create an Azure Function. Add the nuget of "azure-functions-openapi-extension".
2. Add the line `[OpenApiParameter(RequestHeaders.corelationID, In = ParameterLocation.Header, Required = true)]'

**Expected behavior**
When we hit to the endpoint from Postman , it should throw an error, where no header is sent.

**Environment (please complete the following information, if applicable):**
- OS:- Windows
- Browser:- Edge

**Additional context**
For reference :-[ Stack OverFlow](https://stackoverflow.com/questions/76943616/openapiparametermandatory-header-not-working/76945313?noredirect=1#comment135644980_76945313)

Contributor guide

Open the contributing guide

Research direction

Start at the OpenApiParameter attribute on the Azure Functions endpoint and compare the generated OpenAPI document with the request behavior in Postman. Determine whether Required=true is intended only to describe the API contract or to enforce runtime validation; done means the expected behavior is verified and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, openapi
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.