I am using OpenAPI 3.0 to describe the schema of the APIs which are running. I have to require two parameters in different locations. What I want to achieve:
parameters:
- oneOf:
- in: cookie
name: username
description: User's name
schema:
type: string
required: true
- in: query
name: nickname
description: User's nickname
schema:
type: string
required: true
I have read
- How to require at least one of two parameters in OpenAPI?
- How to define mutually exclusive query parameters in Swagger (OpenAPI)?
But those solutions only solve the problems when the parameters are in the same location, so they did not solve my problem.