tarunmaisuri
5 years agoVisitor
Swagger required OpenApiParameter for header
Hi,
Im using Swaasbuckle v5 for .net core v3.
When I made my OpenApiParameter required to true its not allowing me to submit the request and alwasy fires required validation even if I enter data.
operation.Parameters.Add(new OpenApiParameter { Name = "apiAccessKey", In = ParameterLocation.Header, Required = true, Schema = new OpenApiSchema { Type = nameof(String) } });
//Below line is from startup when adding swagger options
c.OperationFilter<AddRequiredHeaderParameter>();
Thanks.