Getting started with OpenAPI in your Backstage plugins
Target Audience: Plugin developers
Difficulty: Medium
Goal
The goal of this tutorial is to give you exposure to tools that more tightly couple your OpenAPI specification and plugin lifecycle. The tools we'll be presenting were created by the OpenAPI tooling project area and allow you to create,
- A typed
express
router that provides strong guardrails during development for input and output values. Support for query, path parameters, and request body, as well as experimental support for headers and cookies. - An auto-generated client to interact with your plugin's backend. Support for all request types, parameters, and body, as well as return types. Provides a low-level interface to allow more customization by higher-level libraries.
- Validation and verification tooling to ensure your API and specification stay in sync. Includes testing against your unit tests.
Prerequisites
Technical Knowledge
This tutorial assumes that you're already familiar with the following,
- How to build a Backstage plugin.
Express.js
andTypescript
- OpenAPI 3.0 schemas