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

Getting error while trying to validate the header against oas policy

When I'm trying to validate the request content against the oas policy by passing the required header named X-My-Header which is an type of array, there were no errors when I sent one value in that header but whenever I'm trying to send multiple values in it Teja_0-1675767130076.png
Getting error like this:

 

"OASValidation OpenAPI-Spec-Validation-1 with resource \"oas://OpenAPI-Spec-Validation-1.yaml\": failed with reason: \"[ERROR - Parameter 'X-My-Header' expected an array style of 'simple' [explode=false].: []]\""

 

I got to know that for headers default serialization method is simple style with 

explode=false which means comma-separated values But even when Im sending in that way also getting error


Here is the spec parameter part: (using spec version 3.0.1)

 

X-My-Header:
      name: X-My-Header
      in: header
      description: test
      required: true
      schema:
        type: array
        items:
          type: number
          enum: 
            - 1
            - 2

 

 Please help me here. Thanks in advance

2 6 1,310
6 REPLIES 6