Using swaggo/swag in go, and I wonder if there’s a way to omit some fields in the generated examples while keeping them in the schema.
type Blah struct {
FieldOne string `json:"field_one"`
FieldTwo string `json:"field_two"`
}
Let’s say FieldTwo
here is something I’m being forced to add, and I’m required to have it in the schema but I don’t want users to use it so I’d like to omit it from examples entirely, is there a way to do so ?
I’ve tried the tag swaggerignore:"true"
but that takes it out of the schema entirely. I’ve tried setting json to omitempty and setting example to an empty string, but it still shows up empty in the examples.
Thanks