No validation for custom headers
See original GitHub issueHi,
I have defined in my open api spec required headers for an endpoint and although not received, the validator doesn’t reject the request and performs no validation.
example of the open-api spec:
get:
responses:
'200':
description: A JSON array of objects
parameters:
- name: x-userId
in: header
schema:
type: string
maxLength: 255
required: true
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Can I use model validation to validate HTTP headers in .Net ...
I think there is no default validation method for custom headers in asp.net core, you need to implement it by custom methods.
Read more >enforcing custom headers - MSDN - Microsoft
I know we can validate if the custom header entry and value exist but I am curious if a way exists to have...
Read more >CSRF protection with custom headers (and without validating ...
The first method involves setting custom headers for each REST request such as X-XSRF-Header. The value of this header does not matter; simply ......
Read more >Pass custom headers through API Gateway to a Lambda ...
I want to configure an AWS Lambda function through custom (non-proxy) integration to process custom headers that are passed through my ...
Read more >How to Add Custom Headers in ASP.NET Core Web API
If we want a clean and reusable method for adding the same custom header to multiple Web API endpoints, or even at the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Excellent. Glad you sorted it out. Please let me know if the documentation needs updating to make this clear. Thanks @stanleynguyen
Hi. I am running into the exact same issue in Java/SpringBoot. My version of openapi-generator-maven-plugin is 4.3.1. (I don’t think it’s relevant, by my version of springdoc-openapi-ui is 1.6.0.) When I switch from in: query to in: header, these annotations disappear from the generated api class: @NotNull @Size(min=5,max=10) @Valid Any ideas? Do you have any examples written in Java?