Skip to main content

Mutual recursion between Person and Address

GET 

/person

Person has an address referencing Address, and Address has an occupants array referencing Person. Tests circular refs across two mutually recursive schemas.

Schema:

Person:
type: object
properties:
name:
type: string
email:
type: string
format: email
address:
$ref: "#/components/schemas/Address"

Address:
type: object
properties:
street:
type: string
city:
type: string
occupants:
type: array
items:
$ref: "#/components/schemas/Person"

Responses

A person