Class: ODataResponseInterceptor
Defined in: packages/core/src/response/odata-response.interceptor.ts:44
NestJS interceptor that wraps ODataQueryResult into an OData v4 JSON envelope.
Per D-05: only activates on routes that have ODATA_ROUTE_KEY metadata (set by @ODataGet()). Non-OData routes pass through completely unchanged (T-03-09).
Response format: { '@odata.context': '/odata/$metadata#EntitySet', '@odata.id': '/odata/EntitySet(key)', (per RESP-04) '@odata.type': '#Namespace.EntityType', (per RESP-05) '{nav}@odata.navigationLink': '...', (per RESP-06) 'value': [...], '@odata.count': N, (only when present) '@odata.nextLink': '...' (only when present) }
Per D-08: undefined keys are omitted entirely — not set to null or undefined.
Zero TypeORM imports — per PKG-01 architecture constraint.
Implements
NestInterceptor
Constructors
Constructor
new ODataResponseInterceptor(
reflector,options,edmRegistry):ODataResponseInterceptor
Defined in: packages/core/src/response/odata-response.interceptor.ts:45
Parameters
reflector
Reflector
options
edmRegistry
Returns
ODataResponseInterceptor
Methods
intercept()
intercept(
context,next):Observable<unknown>
Defined in: packages/core/src/response/odata-response.interceptor.ts:68
Method to implement a custom interceptor.
Parameters
context
ExecutionContext
an ExecutionContext object providing methods to access the route handler and class about to be invoked.
next
CallHandler
a reference to the CallHandler, which provides access to an Observable representing the response stream from the route handler.
Returns
Observable<unknown>
Implementation of
NestInterceptor.intercept