Installation
Installation
Section titled “Installation”This guide will walk you through installing the Nx Plugin OpenAPI in your Nx workspace.
Prerequisites
Section titled “Prerequisites”Before installing the plugin, make sure you have:
- An existing Nx workspace
- Node.js and npm installed
Option 1: Automatic Installation (Recommended)
Section titled “Option 1: Automatic Installation (Recommended)”The easiest way to install the plugin is using the nx add
command:
nx add @lambda-solutions/nx-plugin-openapi
This command will:
- Install the plugin package
- Install the required peer dependency (
@openapitools/openapi-generator-cli
)
Installation Options
Section titled “Installation Options”You can customize the installation by passing options:
# Skip formatting after installationnx add @lambda-solutions/nx-plugin-openapi --skipFormat=true
Option | Type | Default | Description |
---|---|---|---|
skipFormat | boolean | false | Skip formatting the workspace after installation |
Option 2: Manual Installation
Section titled “Option 2: Manual Installation”If you prefer manual installation, you can install the packages separately:
1. Install the Plugin
Section titled “1. Install the Plugin”npm install --save-dev @lambda-solutions/nx-plugin-openapi
2. Install OpenAPI Generator CLI
Section titled “2. Install OpenAPI Generator CLI”The plugin requires the OpenAPI Generator CLI as a peer dependency:
npm install --save-dev @openapitools/openapi-generator-cli
Verification
Section titled “Verification”After installation, verify the plugin is working by checking the available executors:
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
Next Steps
Section titled “Next Steps”Now that the plugin is installed, you can:
- Configure your first project to use the
generate-api
executor - Learn about advanced configuration options
- Explore examples for common use cases
If you encounter issues, please file an issue on GitHub.