Skip to content

ng-openapiAngular OpenAPI Client Generator

Type-safe Angular services, models, and validation schemas β€” generated straight from your OpenAPI specification.

ng-openapi logo

Introduction ​

ng-openapi is a modern Angular-first OpenAPI client generator that creates type-safe services and interfaces from your OpenAPI specifications. Unlike generic TypeScript generators, ng-openapi is built specifically for Angular developers who want clean, maintainable code that leverages Angular's latest features.

Quick Example ​

bash
# Install ng-openapi
npm install ng-openapi --save-dev

# Generate from OpenAPI spec
ng-openapi -i swagger.json -o ./src/api
typescript
// Use in your Angular app
import { provideDefaultClient } from './api/providers';

export const appConfig: ApplicationConfig = {
  providers: [
    provideDefaultClient({ basePath: 'https://api.example.com' })
  ]
};

What's Included ​

  • TypeScript Interfaces - Accurate type definitions from your OpenAPI schemas
  • Angular Services - Injectable services with proper dependency injection
  • HTTP Interceptors - Automatic date transformation and custom headers
  • Provider Functions - Easy setup with provideDefaultClient()
  • File Utilities - Download helpers and file handling
  • CLI Tool - Powerful command-line interface with config file support

See Generated Output for a tour of every generated file.

Support the Project ​

ng-openapi’s mission is to remain the #1 Angular client generation library. If you’d like to support this journey, feel free to sponsor me with a coffee β€” after all, we all know a developer’s fuel is coffee πŸ˜„

Released under the MIT License.
This site is powered by Netlify
Impressum