OpraHttpNestjsAdapter
HttpAdapter subclass that integrates OPRA's HTTP processing into NestJS. At module initialisation it generates NestJS controller classes from OPRA HttpController definitions and registers them with the NestJS IoC container.
import { OpraHttpNestjsAdapter } from '@opra/nestjs-http';
Extends: HttpAdapter (@opra/http)
You do not instantiate this class directly — OpraHttpModule creates and registers it automatically.
Properties
| Property | Type | Description |
|---|---|---|
platform | 'nestjs' | Identifies the platform. |
nestControllers | Type[] | The generated NestJS controller classes registered for this adapter. |
How it works
When OpraHttpModule initialises, OpraHttpNestjsAdapter:
- Walks every
HttpControllerin theApiDocument - Generates a NestJS
@Controllerclass for each one, with@Get,@Post, … decorators on each operation method - Copies OPRA metadata and NestJS guards/interceptors/filters from the original controller class onto the generated class (via
OpraNestUtils.copyDecoratorMetadata) - Registers the generated controllers with NestJS
- Exposes
GET /$schemafor the API document (public by default ifschemaIsPublicis set)
Each request flows through NestJS routing into the adapter's handleRawRequest → OPRA context creation → handler dispatch → response serialisation pipeline, identical to the standalone ExpressAdapter pipeline.