learn.openapis.org icon indicating copy to clipboard operation
learn.openapis.org copied to clipboard

oneOf or anyOf for the header schema

Open triptesh1212 opened this issue 1 year ago • 1 comments

Hi community, can we define an open api 3.0 specification where the schema of a header contains oneOf or anyOf ?

{
   "name": "apiKey",
   "in": "header",
   "required": true,
   "schema": {
        "anyOf": [
             {
                  "type": "boolean"
              },
             {
                  "type": "integer"
             }
         ]
     }
}

Thanks, Triptesh

triptesh1212 avatar Apr 29 '24 07:04 triptesh1212

The value of schema is a Schema Object which explicitly allows anyOf, so this should work.

ralfhandl avatar Apr 29 '24 09:04 ralfhandl