OAI / learn.openapis.org

OpenAPI - Getting started, and the specification explained
https://learn.openapis.org/
Creative Commons Attribution 4.0 International
112 stars 56 forks source link

oneOf or anyOf for the header schema #94

Open triptesh1212 opened 4 months ago

triptesh1212 commented 4 months ago

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

ralfhandl commented 4 months ago

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