title: How to require at least one of two parameters in different locations in OpenAPI?
body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I have read</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/53782328/how-to-require-at-least-one-of-two-parameters-in-openapi">How to require at least one of two parameters in OpenAPI?</a></li>
  <li><a href="https://stackoverflow.com/questions/21134029/how-to-define-mutually-exclusive-query-parameters-in-swagger-openapi/49199240#49199240">How to define mutually exclusive query parameters in Swagger (OpenAPI)?</a></li>
  </ul>
  
  <p>But those solutions only solve the problems when the parameters are in the same location, so they did not solve my problem.</p>