I'm having a hard time trying to figure out how I can nest models in OpenAPI 2.0.
Currently I have:
SomeModel:
properties:
prop1:
type: string
prop2:
type: integer
prop3:
type:
$ref: OtherModel
OtherModel:
properties:
otherProp:
type: string
I have tried many other ways:
prop3:
$ref: OtherModel
# or
prop3:
schema:
$ref: OtherModel
# or
prop3:
type:
schema:
$ref: OtherModel
None of the above seem to work.
However, with arrays works just fine:
prop3:
type: array
items:
$ref: OtherModel