podhmo / reflect-openapi

Define OpenAPI with reflect package
Apache License 2.0
3 stars 0 forks source link

use omitempty in json tag , instead of required tag? #110

Closed podhmo closed 1 year ago

podhmo commented 1 year ago
type Ob struct {
    Name   string `json:"name"` // required
    Age    int    `json:"age,omitempty"`
    Parent *Ob    `json:"parent"`

    Nickname int  `json:"nickname,omitempty" required:"true"` // required
    Status   bool `json:"status" required:"false"`
}