bug2038

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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inner

type Inner struct {
	InnerField string `json:"inner_field"`
}

Inner is embedded by the models below.

swagger:model

type Squashed

type Squashed struct {
	OuterField string `json:"outer_field"`
	Inner      `json:"-"`
}

Squashed embeds Inner but squashes it with `json:"-"`. Go's encoding/json drops the embed entirely: it is neither promoted nor nested. The schema must contain only outer_field (go-swagger#2038).

swagger:model

type Tagged

type Tagged struct {
	OuterField string `json:"outer_field"`
	Inner      `json:"inner"`
}

Tagged embeds Inner WITH an explicit json tag. Go's encoding/json NESTS the embedded value under "inner" (it is no longer promoted). The generated spec must match: an `inner` property, not promoted inner_field (go-swagger#2038).

swagger:model

type TaggedAllOf

type TaggedAllOf struct {
	OuterField string `json:"outer_field"`
	// swagger:allOf
	Inner `json:"inner"`
}

TaggedAllOf embeds Inner with BOTH an explicit json tag AND a swagger:allOf annotation. The explicit composition annotation wins: the embed becomes an allOf member ($ref to Inner), the json tag does NOT cause nesting. This proves the json-tag nesting path fires only for plain (non-allOf) embeds.

swagger:model

type Untagged

type Untagged struct {
	OuterField string `json:"outer_field"`
	Inner
}

Untagged embeds Inner WITHOUT a json tag — Go promotes (flattens) its fields. This is the green guard rail: promotion is correct here.

swagger:model

Jump to

Keyboard shortcuts

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