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.
Building a simple API - REST Tutorial
From the course: Building APIs with Swagger and the OpenAPI Specification
Building a simple API
- [Instructor] In this lesson, we'll build The API will respond to the request by returning Our API definition is going to be very minimal We can discover what fields or objects by visiting the OpenAPI specification. Here we are at the OAS 3.0 specification and if we navigate to the schema section it will list the different sections The OpenAPI field, the info field and the paths field. and that provides clues to Swagger Editor and we see the info field. the API itself, such as the title of the API. and we'll say it's version one. To do that, we first specify a path object. In this case, we're going to be exposing the product endpoint. Within that product endpoint, we're going to expose the get operation, which corresponds to the HTTP method that will be used to invoke this operation. to invoke this operation. You'll notice that we're using YAML. You'll notice that we're using YAML. So, it's important to indent two spaces when we have different fields on an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Swagger ecosystem4m 5s
-
(Locked)
Open-source tools4m
-
(Locked)
OpenAPI Specification4m 23s
-
(Locked)
Open-source tool installation4m 58s
-
(Locked)
H+ Sport intro31s
-
(Locked)
Building a simple API5m 40s
-
(Locked)
Challenge: Retrieve company blog posts1m 5s
-
(Locked)
Solution: Retrieve company blog posts4m 26s
-
-
-
-
-