Documentation
¶
Overview ¶
Package bug3005 covers go-swagger issue #3005 ("additionalProperties are lost when generating spec from code"): a model wants named properties AND additionalProperties. The reporter carried the latter on a json:"-" map field, which is muted; the resolution is the explicit type-level marker `swagger:additionalProperties <spec>`, which restates the value type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestAdditionalProperties ¶
type TestAdditionalProperties struct {
// field1
Field1 string `json:"field1,omitempty"`
// The map that motivated #3005 stays muted (json:"-"); the marker above
// supplies the additionalProperties schema.
TestAdditionalProperties map[string]float64 `json:"-"`
}
TestAdditionalProperties has a named property plus free-form number values.
swagger:model TestAdditionalProperties swagger:additionalProperties number
Click to show internal directories.
Click to hide internal directories.