fixing Access-Control-Allow-Origin rule for response headers #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check for Access-Control-Allow-Origin doesn't need to check all the headers, it only need to check the response headers. Otherwise it will show the error for header schema defined in components.
Motivation and Context
The rule is creating false error, it says headers in components are missing Access-Control-Allow-Origin. This check should check only response headers, not header schema defined under components. header ref schema defined in components may have different name (for ex: '#/components/headers/AccessControlAllowOrigin'
RateLimit-Limit:)
#InsertIssueNumberHere
Description
Updated the rule given to only check response headers
given: $..[responses][*].headers
How Has This Been Tested?
This is tested locally in locally test environments and test and production grade API contracts (Open API specification)
Screenshot(s)/recordings(s)
Types of changes
Checklist