Documentation
    Preparing search index...
    • Attach an example value to a request parameter (body, path, query, etc.) of a controller method.

      Two forms are supported:

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

      Apply alongside the actual parameter decorator (@TypedBody(), @TypedParam(), @TypedQuery(), etc.); decorator order does not matter.

      Type Parameters

      • T

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

      Parameters

      • value: T

      Returns ParameterDecorator

      contracts/common.md#principled-implementation The value or the keyed value is recorded on the record for that parameter index, so several parameters keep separate examples.

      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 a request parameter (body, path, query, etc.) of a controller method.

      Two forms are supported:

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

      Apply alongside the actual parameter decorator (@TypedBody(), @TypedParam(), @TypedQuery(), etc.); decorator order does not matter.

      Type Parameters

      • T

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

      Parameters

      • key: string
      • value: T

      Returns ParameterDecorator

      contracts/common.md#principled-implementation The value or the keyed value is recorded on the record for that parameter index, so several parameters keep separate examples.

      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.