SwaggerExample is a namespace of decorators that attach example values to
controller methods (request/response bodies, parameters), so that
@nestia/sdk's Swagger generator can populate the example / examples
fields of the generated OpenAPI document.
The decorators only affect Swagger document generation. They do not change
runtime behavior, validation, or SDK function signatures.
contracts/common.md#principled-implementation Examples are stored as metadata on the method or on the parameter position; a call with one argument sets the single example, and a call with a key and a value adds a named example, so both OpenAPI forms are expressible.
Evidence
contracts/common.md#clear-and-simple-design Two decorators over three private metadata helpers that find or create the record.
Evidence
contracts/common.md#prohibited-implementation-shortcuts The examples are caller data, and nothing is generated here.
Evidence
contracts/common.md#meaningful-documentation The comment documents both decorators and the two call forms.
Evidence Exclude
contracts/portability.md#os-neutral-implementation Example metadata contains caller values and parameter indices without a native path or process boundary.
Attach example values to Swagger documents.
SwaggerExampleis a namespace of decorators that attach example values to controller methods (request/response bodies, parameters), so that@nestia/sdk's Swagger generator can populate theexample/examplesfields of the generated OpenAPI document.The decorators only affect Swagger document generation. They do not change runtime behavior, validation, or SDK function signatures.
Example:
Author
Jeongho Nam - https://github.com/samchon
Evidence
contracts/common.md#principled-implementation Examples are stored as metadata on the method or on the parameter position; a call with one argument sets the single example, and a call with a key and a value adds a named example, so both OpenAPI forms are expressible.
Evidence
contracts/common.md#clear-and-simple-design Two decorators over three private metadata helpers that find or create the record.
Evidence
contracts/common.md#prohibited-implementation-shortcuts The examples are caller data, and nothing is generated here.
Evidence
contracts/common.md#meaningful-documentation The comment documents both decorators and the two call forms.
Evidence Exclude
contracts/portability.md#os-neutral-implementation Example metadata contains caller values and parameter indices without a native path or process boundary.