Forum Discussion

tarunmaisuri's avatar
5 years ago

Swagger required OpenApiParameter for header


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