bug3069

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package bug3069 demonstrates the resolution to go-swagger issue #3069 ("Is there a way to change the representation of one parameter of the request object?"). ComplexType has a custom JSON marshaller that emits a dotted string, so its struct shape (A/B/C) does not match the wire format. codescan cannot infer a custom MarshalJSON, but a `swagger:type` override (or implementing encoding.TextMarshaler / swagger:strfmt) lets the author state the representation explicitly — here, string — so a []ComplexType field renders as an array of strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComplexType

type ComplexType struct {
	A string
	B string
	C string
}

ComplexType marshals to a dotted string; the override states that.

swagger:type string

type MyResponse

type MyResponse struct {
	// List of complex types.
	ComplexType []ComplexType `json:"complexType"`
}

swagger:model MyResponse

Jump to

Keyboard shortcuts

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