I have two definitions as a part of .yaml file as shown below:
definitions:
EmployeeModel:
type: object
properties:
id:
type: integer
name:
type: string
AddressModel:
type: object
properties:
id:
type: integer
city:
type: string
employee:
$ref: '#/definitions/EmployeeModel'
I want to change the address model such that the property 'employee' can either be an integer or a reference to EmployeeModel.
Is this possible? I have tried using oneOf and the result looked something like:
employee:
oneOf:
- type: integer
- $ref: '#/defintions/EmployeeMap'
Is this the right way?