allOf Demo (2022-05-03)

Download OpenAPI specification:Download

Example for a blog post about extending schemas with allOf. The try it and code samples interact with mock servers.

Create address

Request
Request Body schema: application/json
line1
required
string
line2
string
city
required
string
Responses
201

Address created

post/addresses
Request samples
application/json
{
  • "line1": "123 Main Street",
  • "line2": "Suite 301",
  • "city": "Austin"
}
Response samples
application/json
{
  • "id": "string",
  • "line1": "123 Main Street",
  • "line2": "Suite 301",
  • "city": "Austin"
}

Update address

Request
path Parameters
id
required
string

ID of address

Request Body schema: application/json
line1
string
line2
string
city
string
Responses
200

Address updated

patch/addresses/{id}
Request samples
application/json
{
  • "line1": "123 Main Street",
  • "line2": "Suite 301",
  • "city": "Austin"
}
Response samples
application/json
{
  • "id": "string",
  • "line1": "123 Main Street",
  • "line2": "Suite 301",
  • "city": "Austin"
}