Skip to content

Overview

The Nx Plugin OpenAPI brings first-class support for generating API client code from OpenAPI specifications within your Nx workspace, leveraging all the powerful features of the Nx task pipeline.

The project is structured as a modular plugin system, allowing you to choose the code generator that best fits your needs:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ @nx-plugin-openapi/core β”‚
β”‚ Executor, Plugin Loader, Auto-Installation β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ plugin-openapi β”‚ β”‚ plugin-hey-api β”‚
β”‚ (OpenAPI Generator) β”‚ β”‚ (hey-api/openapi-ts) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
GeneratorPluginDescription
openapi-tools@nx-plugin-openapi/plugin-openapiUses OpenAPI Generator - supports 50+ languages including TypeScript Angular
hey-api@nx-plugin-openapi/plugin-hey-apiUses hey-api/openapi-ts - modern TypeScript-first client generation
  • Uses standard Nx executors and configuration
  • Integrates with Nx’s dependency graph
  • Supports Nx’s powerful caching system
  • Works with Nx Cloud for distributed caching
  • Only regenerates when OpenAPI specs change
  • Supports both local and remote OpenAPI specifications
  • Caches based on file content, not timestamps
  • Dramatically speeds up builds in large monorepos
  • Choose the generator that fits your project needs
  • Plugins are auto-installed when first used
  • Pass generator-specific options via generatorOptions
  • Support for multiple OpenAPI specifications in a single target
  • Create custom plugins for any OpenAPI generator
  • Battle-tested generators used in thousands of production applications
  • Comprehensive configuration options for customization
  • TypeScript-safe configuration through JSON schema

Best for:

  • Angular applications needing injectable services
  • Projects requiring specific OpenAPI Generator templates
  • Teams familiar with OpenAPI Generator ecosystem
  • Supporting multiple languages/frameworks

Best for:

  • Modern TypeScript/JavaScript projects
  • Projects prioritizing type safety
  • Fetch-based HTTP clients
  • Simpler, more lightweight generated code

Need to integrate a different OpenAPI generator? The plugin architecture makes it easy to create custom plugins for any code generator. See our Creating Custom Plugins guide for a complete walkthrough.

Ready to get started? Let’s install the plugin in your Nx workspace.