Documentation
¶
Overview ¶
Package alias_calibration_stdlib exercises the schema builder's alias handling for stdlib-special RHS types (`time.Time`, `error`, `json.RawMessage`, `any`). `applyStdlibSpecials` recognises these types at the schema layer; this fixture asserts the recognizer fires across the `buildDeclAlias` dispatch paths regardless of mode.
Cells exercised:
- decl × annotated × stdlib(time.Time) → Timestamp
- decl × annotated × stdlib(error) → Err
- decl × annotated × stdlib(json.RawMessage) → Raw
- decl × unannotated × stdlib(time.Time) → SilentTime
- field × annotated alias → Envelope.at / .failure / .payload
- field × unannotated alias → Envelope.silent
See the schema builder's alias-handling and special-types contracts: [§aliases](../../../internal/builders/schema/README.md#aliases), [§special-types](../../../internal/builders/schema/README.md#special-types).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
// At — annotated stdlib-time alias in field position.
At Timestamp `json:"at"`
// Failure — annotated stdlib-error alias in field position.
Failure Err `json:"failure,omitempty"`
// Payload — annotated json.RawMessage alias in field position.
Payload Raw `json:"payload"`
// Silent — UNANNOTATED stdlib-time alias in field position.
Silent SilentTime `json:"silent"`
}
Envelope uses all four aliases as field types: three annotated, one unannotated. Exercises the field-reach context for each.
swagger:model Envelope
type Err ¶
type Err = error
Err is an alias to the predeclared error interface exposed as a top-level model. Stdlib-special.
swagger:model Err
type Raw ¶
type Raw = json.RawMessage
Raw is an alias to json.RawMessage exposed as a top-level model. Stdlib-special.
swagger:model Raw
type SilentTime ¶
SilentTime is an alias to time.Time with NO swagger:model annotation — reachable only via Envelope.Silent. Tests that the annotation gate at use sites holds for stdlib-special RHS just as it does for primitive RHS: the unannotated alias dissolves and the recognizer's canonical shape lands inline at the `Envelope.silent` field site.