Modern Angular
Generated code uses inject(), provider functions, and optionally the httpResource API β no legacy module boilerplate.
Angular integration
Type-safe Angular services, models, and validation schemas β generated straight from your OpenAPI specification.
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.
# Install ng-openapi
npm install ng-openapi --save-dev
# Generate from OpenAPI spec
ng-openapi -i swagger.json -o ./src/api// Use in your Angular app
import { provideDefaultClient } from './api/providers';
export const appConfig: ApplicationConfig = {
providers: [
provideDefaultClient({ basePath: 'https://api.example.com' })
]
};provideDefaultClient()See Generated Output for a tour of every generated file.
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 π