cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding OA3, for anyOf, oneOf, allOf refrences, what should be data type of the schema ?

ramuklawjju
Regular Visitor

Regarding OA3, for anyOf, oneOf, allOf refrences, what should be data type of the schema ?

In the below example, can the Cat or Dog be of scalar types ? like integer/string ? or only object type ?

 

 

paths:
  /pets:
    patch:
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Cat'
                - $ref: '#/components/schemas/Dog'
      responses:
        '200':
          description: Updated
components:
  schemas:
    Dog:
      type: object
      properties:
        bark:
          type: boolean
        breed:
          type: string
          enum: [Dingo, Husky, Retriever, Shepherd]
    Cat:
      type: object
      properties:
        hunts:
          type: boolean
        age:
          type: integer

 

 

Tags (1)
New Here?
Join us and watch the welcome video: