func (g *Generator) SetSortTags(b bool) {
	g.sortTags = b
}
SetSortTags controls whether the generator should
sort the global tags sections.
package openapi
import (
	"errors"
	"fmt"
	"net/http"
	"reflect"
	"regexp"
	"sort"
	"strconv"
	"strings"
	"github.com/gofrs/uuid"
	"github.com/loopfz/gadgeto/tonic"
)
const (
	version              = "3.0.1"
	anyMediaType         = "*/*"
	formatTag            = "format"
	deprecatedTag        = "deprecated"
	descriptionTag       = "description"
	componentsSchemaPath = "#/components/schemas/"
)
var (
	paramsInPathRe = regexp.MustCompile(`\{(.*?)\}`)
	ginPathParamRe = regexp.MustCompile(`\/:([^\/]*)`)
)
var mediaTags = map[string]string{
	"application/json": "json",
	"application/xml":  "xml",
}
type Generator struct {
	api           *OpenAPI
	config        *SpecGenConfig
	schemaTypes   map[reflect.Type]struct{}
	typeNames     map[reflect.Type]string
	dataTypes     map[reflect.Type]*OverridedDataType
	operationsIDS map[string]struct{}
	errors        []error
	fullNames     bool
	sortParams    bool
	sortTags      bool
}
func NewGenerator(conf *SpecGenConfig) (*Generator, error) {
	if conf == nil {
		return nil, errors.New("missing config")
	}
	components := &Components{
		Schemas:    make(map[string]*SchemaOrRef),
		Responses:  make(map[string]*ResponseOrRef),
		Parameters: make(map[string]*ParameterOrRef),
		Headers:    make(map[string]*HeaderOrRef),
	}
	return &Generator{
		config: conf,
		api: &OpenAPI{
			OpenAPI:    version,
			Info:       &Info{},
			Paths:      make(Paths),
			Components: components,
		},
		schemaTypes:   make(map[reflect.Type]struct{}),
		typeNames:     make(map[reflect.Type]string),
		dataTypes:     make(map[reflect.Type]*OverridedDataType),
		operationsIDS: make(map[string]struct{}),
		fullNames:     true,
		sortParams:    true,
		sortTags:      true,
	}, nil
}
type SpecGenConfig struct {
	ValidatorTag      string
	PathLocationTag   string
	QueryLocationTag  string
	HeaderLocationTag string
	EnumTag           string
	DefaultTag        string
}
func (g *Generator) SetInfo(info *Info) {
	g.api.Info = info
}
func (g *Generator) SetServers(servers []*Server) {
	g.api.Servers = servers
}
func (g *Generator) API() *OpenAPI {
	cpy := *g.api
	return &cpy
}
func (g *Generator) Errors() []error {
	return g.errors
}
func (g *Generator) UseFullSchemaNames(b bool) {
	g.fullNames = b
}
func (g *Generator) SetSortParams(b bool) {
	g.sortParams = b
}