title: how define both required and anyof properties in OpenAPI 3.0
body: <p>I am creating an OpenAPI 3 spec for an api which has object for which some property are required and for some they are anyof. When i create the spec as below it throws an error, which i am unable to fix.</p>
  
  <pre><code>EnrollementRequest:
        type: object
        properties:
          consent:
            $ref: "#/components/schemas/ConsentEnum"
          cid:
            $ref: '#/components/schemas/CID'
          card:
            $ref: '#/components/schemas/Card'
          enrollmentDateTime :
            description: The date and time of enrollment with respective timezone
            format: date-time
            example: 2018-11-13T20:20:39+00:00
          campaign_code: 
            description: the campaign-code for which customer wants to enroll
            type: string
          offer_code:
            description: the offer-code for which customer wants to enroll
            type: string
          channelInfo:
            $ref: '#/components/schemas/Channel'
        required:
          - consent
          - cid
          - enrollmentDateTime
          - channelInfo
        anyOf:
          - campaign_code
          - offer_code       
  </code></pre>
  
  <p>Swagger editor gives an error as below -</p>
  
  <pre><code>Errors
  
  Structural error at components.schemas.EnrollementRequest.anyOf.0
  should be object
  Jump to line ...
  Structural error at components.schemas.EnrollementRequest.anyOf.1
  should be object
  Jump to line ...
  </code></pre>
  
  <p>Upon using the suggestion as below</p>
  
  <pre><code>  anyOf:
      - required: [campaign_code]
      - required: [offer_code]
  </code></pre>
  
  <p>the validation error went away but the swagger editor schema / model view is not showing any content as below -</p>
  
  <p><a href="https://i.stack.imgur.com/rjfCF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rjfCF.png" alt="enter image description here"></a></p>