OpenAPI – Generate and use Angular Client Code

Introduction

In one of earlier post, we discussed that An OpenAPI specification is a standard which describes the capabilities of our API, and how to interact with it. We also demonstrated a .NET Core Web API application integrated with OpenAPI/Swagger.

If you haven’t already, I’ll suggest to check the previous post for background information, as we’ll be building on top of those learnings.

OpenAPI Integration Steps

In a typical client/server web application, to integrate OpenAPI, we can use following 3 steps to simplify the process

  1. Integrate OpenAPI within your API
  2. Generate YAML definition file
  3. Generate Angular Client

I am using .NET core for backend (web api) and Angular for frontend part and tooling will be based on these choices. However there is list of OpenAPI generator and packages, if your tech stack is different.

Subscribe to continue reading

Subscribe to get access to the rest of this post and other subscriber-only content.