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

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Solution: Create company blog posts

Solution: Create company blog posts

(upbeat music) - [Instructor] In this video, I'll share my solution for this challenge. To get started, I'm going to add a component section to the bottom of the file. Within this component section, I'm going to create a reusable schema object that represents the article resource. This component will provide us with some reusability throughout the API definition, and we can avoid repeating the article schema object throughout the file. To define the properties on the article schema object, we can go ahead and copy the properties from the object on our get operation. So I'm just going to go ahead and copy these fields and place them within the article schema object at the bottom of the file. Once they're in place, I can go ahead and click on Edit and then convert to YAML and the file will automatically format. Now we can just go ahead and remove those properties from the API definition underneath the get operation.…

Contents