Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Request Accept header '*;q=.2' is not a valid media type

Hi,

 

I am getting the error below while using OAS Validation policy.

 

Header in Request which is causing the issue:

Accept text/html,image/gif,image/jpeg,*;q=.2,*/*;q=.2

 

Error:

OASValidation OpenAPI-Spec-Validation with resource \"oas://Sample.yaml\": failed with reason: \"[ERROR - Request Accept header '*;q=.2' is not a valid media type: []]\"",
 
Tried using the below configuration to bypass this error, but this doesn't help.
 
I understand that the 'Accept' header can be modified to resolve this. However wanted to understand if there are any other ways to solve this !!
 
<OASValidation continueOnError="false" enabled="true" name="OpenAPI-Spec-Validation">
<DisplayName>OpenAPI Spec Validation</DisplayName>
<Properties/>
<Source>request</Source>
<Options>
<AllowUnspecifiedParameters>
<Header>true</Header>
</AllowUnspecifiedParameters>
<ValidateMessageBody>true</ValidateMessageBody>
</Options>
<OASResource>oas://Sample.yaml</OASResource>
</OASValidation>
 
Thanks
0 2 3,460
2 REPLIES 2
Top Solution Authors