bug958

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

Overview

Package bug958 reproduces go-swagger issue #958 ("how to specify sample values in user structs"): a field-level `default:` / `example:` was carried for a plain builtin field but dropped when the field used a named (defined) type such as `type SpecificType string`.

The expected behaviour — locked by the golden — is that both default and example survive for defined-type fields. Because a $ref cannot carry sibling keywords, they ride the override arm of an allOf compound (the same draft-4-compliant shape used for description/example on $ref'd fields; see fixtures/bugs/3125).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefinedStruct

type DefinedStruct struct {
	// Sample value in the struct
	// required: true
	// default: samplesample
	// example: examplevalue
	Value SpecificType `json:"value"`
}

DefinedStruct uses a named (defined) type field carrying both default and example.

swagger:model DefinedStruct

type PlainStruct

type PlainStruct struct {
	// Sample value in the struct
	// required: true
	// default: samplesample
	// example: examplevalue
	Value string `json:"value"`
}

PlainStruct uses a plain string field carrying both default and example.

swagger:model PlainStruct

type SpecificType

type SpecificType string

Jump to

Keyboard shortcuts

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