From the course: Building APIs with Swagger and the OpenAPI Specification

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Nesting schemas in domains

Nesting schemas in domains - REST Tutorial

From the course: Building APIs with Swagger and the OpenAPI Specification

Start my 1-month free trial

Nesting schemas in domains

- [Instructor] Domains are an extremely powerful concept within SwaggerHub. We're going to walk through another demonstration within domains and also nesting some of our schema objects. Let's navigate into the hplus domain to create version two. within our catalog API. that we're going to build within our domain. We'll define a new schema named Order. Within that schema object, we're going to have different properties including an ID We can give an example of this ID property. which will also be of type integer. We can give an example here. Then we're also going to grab the quantity. We want to know how many of these items were ordered Then we're going to specify an order date. This will tell us when the order was placed and this is going to be of type string. But we're going to do something different here where we specify a format property that says this string is using the date-time format. and that means we need to specify the year, and we're just going to add one additional…

Contents