Documentation
    Preparing search index...
    • Attach an example value to the response body of a controller method.

      Two forms are supported:

      • Response(value): registers value as the single default example.
      • Response(key, value): registers value under examples[key]. May be applied multiple times to attach several named examples.

      Both forms can coexist on the same method — the default example and any number of named examples will all surface in the generated Swagger document.

      Type Parameters

      • T

        Type of the example value (typically the route's response DTO).

      Parameters

      • value: T

      Returns MethodDecorator

      contracts/common.md#principled-implementation The value or the keyed value is recorded on the method's response example record, which the document generator reads.

      contracts/common.md#clear-and-simple-design One decorator with two overloads.

      contracts/common.md#prohibited-implementation-shortcuts The value is stored as given.

      contracts/common.md#meaningful-documentation The comment documents the overloads with an example.

      contracts/portability.md#os-neutral-implementation Example metadata contains caller values and parameter indices without a native path or process boundary.

    • Attach an example value to the response body of a controller method.

      Two forms are supported:

      • Response(value): registers value as the single default example.
      • Response(key, value): registers value under examples[key]. May be applied multiple times to attach several named examples.

      Both forms can coexist on the same method — the default example and any number of named examples will all surface in the generated Swagger document.

      Type Parameters

      • T

        Type of the example value (typically the route's response DTO).

      Parameters

      • key: string
      • value: T

      Returns MethodDecorator

      contracts/common.md#principled-implementation The value or the keyed value is recorded on the method's response example record, which the document generator reads.

      contracts/common.md#clear-and-simple-design One decorator with two overloads.

      contracts/common.md#prohibited-implementation-shortcuts The value is stored as given.

      contracts/common.md#meaningful-documentation The comment documents the overloads with an example.

      contracts/portability.md#os-neutral-implementation Example metadata contains caller values and parameter indices without a native path or process boundary.