ref_alias_chain

package
v0.36.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ref_alias_chain exercises buildDeclAlias under RefAliases=true with an alias-of-alias chain and aliases to well-known standard library types (time.Time, any).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseBody

type BaseBody struct {
	// required: true
	ID int64 `json:"id"`

	Name string `json:"name"`
}

BaseBody is the concrete named struct at the bottom of the alias chain.

swagger:model BaseBody

type CountTyped

type CountTyped = any

CountTyped probes the `swagger:type` override on an alias of any. `swagger:type` takes a Go-type name (per `SwaggerSchemaForType`); honoured via `classifierNamedTypeOverride`.

swagger:model CountTyped swagger:type int64

type Datestamp

type Datestamp = any

Datestamp aliases any with a user-provided `swagger:strfmt` annotation. Expected: the alias surfaces as `{string, date}` — the decl-entry strfmt classifier fires before the any-recognizer would otherwise empty the schema.

swagger:model Datestamp swagger:strfmt date

type Envelope

type Envelope struct {
	First LinkA `json:"first"`

	Second LinkB `json:"second"`

	CreatedAt Timestamp `json:"createdAt"`

	Meta Wildcard `json:"meta"`

	// Stamp is typed via the strfmt-annotated alias of `any`.
	Stamp Datestamp `json:"stamp"`

	// Drift uses an unannotated alias of any — the field site
	// dissolves the alias to the underlying.
	Drift Loose `json:"drift"`
}

Envelope references the aliases via its fields so the scanner also walks the schemaBuilder.buildAlias path for each chain member.

swagger:model Envelope

type LinkA

type LinkA = BaseBody

LinkA is a direct alias of BaseBody.

swagger:model LinkA

type LinkB

type LinkB = LinkA

LinkB is an alias of an alias — chain depth two.

swagger:model LinkB

type Loose

type Loose = any

Loose aliases any with NO swagger:model annotation. Reachable only via Envelope.Drift below. Witness for the unannotated case at field sites: the alias dissolves and produces no definition.

type Timestamp

type Timestamp = time.Time

Timestamp aliases time.Time so that buildDeclAlias takes its isStdTime branch.

swagger:model Timestamp

type UserIDStrf

type UserIDStrf = int64

UserIDStrf probes `swagger:strfmt` on an alias of a primitive. Expected: the alias surfaces as `{string, uuid}` — the decl-entry strfmt classifier wins over the primitive underlying.

swagger:model UserIDStrf swagger:strfmt uuid

type Wildcard

type Wildcard = any

Wildcard aliases any so that buildDeclAlias takes its isAny branch.

swagger:model Wildcard

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL