Skip to content

Function: ODataGetByKey()

ODataGetByKey(entitySetName, options?): MethodDecorator

Defined in: packages/core/src/decorators/odata-get-by-key.decorator.ts:23

Composite method decorator for OData GET-by-key (single entity) endpoints.

Composes:

  1. Get(path) — NestJS route decorator, defaults to ':key'
  2. SetMetadata(ODATA_ROUTE_KEY, { entitySetName, operation: 'getByKey', isSingleEntity: true })
  3. UseInterceptors(ODataResponseInterceptor) — returns entity directly (not wrapped in value array)
  4. UseFilters(ODataExceptionFilter) — formats errors as OData v4 error bodies

Per D-05: Returns single entity, not wrapped in value array. Context URL uses /$entity suffix for single-entity responses. Zero TypeORM imports — per PKG-01 architecture constraint.

Parameters

entitySetName

string

options?

ODataGetByKeyOptions

Returns

MethodDecorator