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.

Solution: Retrieve company blog posts

Solution: Retrieve company blog posts - REST Tutorial

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

Start my 1-month free trial

Solution: Retrieve company blog posts

(upbeat music) - [Instructor] Let's take a look at one way to complete the challenge. To begin building an API definition, we need to specify three required fields. The first is the open API field where we specify the version of the OAS specification that we'll be using. In our case that's version three. Next is the info field. Within the info field, we can specify the version of the API as well as a title for it. In this case, it's going to be the H Plus Blog API. And then finally, we're able to specify the paths on the API definition. Within the paths field, we're going to go ahead and specify an article path that's going to be used to retrieve articles from the API. Because we're retrieving resources, it's appropriate to use the get operation. So we'll specify that underneath this path. Next we'll describe the operation's response in the content it returns. In this case, we'd like to describe the 200 HTTP…

Contents