Skip to content

Installation

This guide will walk you through installing the Nx Plugin OpenAPI in your Nx workspace.

Before installing the plugin, make sure you have:

  • An existing Nx workspace
  • Node.js and npm installed
Section titled “Option 1: Automatic Installation (Recommended)”

The easiest way to install the plugin is using the nx add command:

Terminal window
nx add @lambda-solutions/nx-plugin-openapi

This command will:

  • Install the plugin package
  • Install the required peer dependency (@openapitools/openapi-generator-cli)

You can customize the installation by passing options:

Terminal window
# Skip formatting after installation
nx add @lambda-solutions/nx-plugin-openapi --skipFormat=true
OptionTypeDefaultDescription
skipFormatbooleanfalseSkip formatting the workspace after installation

If you prefer manual installation, you can install the packages separately:

Terminal window
npm install --save-dev @lambda-solutions/nx-plugin-openapi

The plugin requires the OpenAPI Generator CLI as a peer dependency:

Terminal window
npm install --save-dev @openapitools/openapi-generator-cli

After installation, verify the plugin is working by checking the available executors:

Terminal window
nx list @lambda-solutions/nx-plugin-openapi

You should see output similar to:

@lambda-solutions/nx-plugin-openapi
Executors:
- generate-api : Generate API client code from OpenAPI specifications

Now that the plugin is installed, you can:

  1. Configure your first project to use the generate-api executor
  2. Learn about advanced configuration options
  3. Explore examples for common use cases

If you encounter issues, please file an issue on GitHub.