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

Unlock the full course today

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

Client SDK internals

Client SDK internals - REST Tutorial

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

Start my 1-month free trial

Client SDK internals

- [Instructor] If we take a look at the code for the app, we can see how our client SDK called back to the API. So the first thing we'll take a look at, is the app.component.ts file. This is the typescript file that's associated with our app component. You'll notice that it uses a productService. This productService is provided from the client SDK that we generated with Swagger Hub. We can navigate into the rest directory, and then into the API directory in order to see the product service. I'm going to go ahead and hide our sidebar in order to get a better view of this code. Okay, if we scroll down into this file, you'll notice that the product service has a URL to the Swagger Hub virtual server where it's making the API calls. All of the code in order to perform the calls to our API is contained within this service. So here we see our operations and the corresponding typescript that we need to make the calls from the client SDK. All of this code was generated for us by Swagger Hub.

Contents