Closed
Description
Problem statement
Currently, we use x-omitempty
to exclude null array value. related PR #1189
Maybe x-omitempty
can support general type to control the omityempty
tag.
Foo:
type: "object"
properties:
hasOmitEmptyTrue:
type: string
x-omitempty: true
hasOmitEmptyFalse:
type: string
x-omitempty: false
produce
type Foo struct {
// has omit empty false
HasOmitEmptyFalse string `json:"hasOmitEmptyFalse"`
// has omit empty true
HasOmitEmptyTrue string `json:"hasOmitEmptyTrue,omitempty"`
}
Swagger specification
Steps to reproduce
Environment
swagger version: x.x.x
go version: x.x.x
OS: