[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)

* Update go-swagger

* vendor
This commit is contained in:
6543 2020-09-01 16:01:23 +02:00 committed by GitHub
parent 66843f2237
commit 3270e7a443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
350 changed files with 26353 additions and 5552 deletions

View file

@ -28,7 +28,7 @@ type GenDefinition struct {
GenSchema
Package string
Imports map[string]string
DefaultImports []string
DefaultImports map[string]string
ExtraSchemas GenSchemaList
DependsOn []string
External bool
@ -91,6 +91,9 @@ type GenSchema struct {
IncludeValidator bool
IncludeModel bool
Default interface{}
WantsMarshalBinary bool // do we generate MarshalBinary interface?
StructTags []string
ExtraImports map[string]string // non-standard imports detected when using external types
}
func (g GenSchemaList) Len() int { return len(g) }
@ -167,9 +170,12 @@ type GenResponse struct {
AllowsForStreaming bool
Imports map[string]string
DefaultImports []string
DefaultImports map[string]string
Extensions map[string]interface{}
StrictResponders bool
OperationName string
}
// GenHeader represents a header on a response for code generation
@ -355,6 +361,8 @@ type GenItems struct {
// instructs generator to skip the splitting and parsing from CollectionFormat
SkipParse bool
// instructs generator that some nested structure needs an higher level loop index
NeedsIndex bool
}
// ItemsDepth returns a string "items.items..." with as many items as the level of nesting of the array.
@ -378,9 +386,10 @@ type GenOperationGroup struct {
Summary string
Description string
Imports map[string]string
DefaultImports []string
DefaultImports map[string]string
RootPackage string
GenOpts *GenOpts
PackageAlias string
}
// GenOperationGroups is a sorted collection of operation groups
@ -398,13 +407,20 @@ func (g GenStatusCodeResponses) Swap(i, j int) { g[i], g[j] = g[j], g[i] }
func (g GenStatusCodeResponses) Less(i, j int) bool { return g[i].Code < g[j].Code }
// MarshalJSON marshals these responses to json
//
// This is used by DumpData.
func (g GenStatusCodeResponses) MarshalJSON() ([]byte, error) {
if g == nil {
return nil, nil
}
responses := make(GenStatusCodeResponses, len(g))
copy(responses, g)
// order marshalled output
sort.Sort(responses)
var buf bytes.Buffer
buf.WriteRune('{')
for i, v := range g {
for i, v := range responses {
rb, err := json.Marshal(v)
if err != nil {
return nil, err
@ -446,11 +462,13 @@ type GenOperation struct {
Path string
BasePath string
Tags []string
UseTags bool
RootPackage string
Imports map[string]string
DefaultImports []string
DefaultImports map[string]string
ExtraSchemas GenSchemaList
PackageAlias string
Authorized bool
Security []GenSecurityRequirements
@ -483,6 +501,8 @@ type GenOperation struct {
TimeoutName string
Extensions map[string]interface{}
StrictResponders bool
}
// GenOperations represents a list of operations to generate
@ -509,7 +529,7 @@ type GenApp struct {
Info *spec.Info
ExternalDocs *spec.ExternalDocumentation
Imports map[string]string
DefaultImports []string
DefaultImports map[string]string
Schemes []string
ExtraSchemes []string
Consumes GenSerGroups
@ -521,7 +541,7 @@ type GenApp struct {
SwaggerJSON string
// Embedded specs: this is important for when the generated server adds routes.
// NOTE: there is a distinct advantage to having this in runtime rather than generated code.
// We are noti ever going to generate the router.
// We are not ever going to generate the router.
// If embedding spec is an issue (e.g. memory usage), this can be excluded with the --exclude-spec
// generation option. Alternative methods to serve spec (e.g. from disk, ...) may be implemented by
// adding a middleware to the generated API.
@ -563,16 +583,14 @@ type GenSerGroups []GenSerGroup
func (g GenSerGroups) Len() int { return len(g) }
func (g GenSerGroups) Swap(i, j int) { g[i], g[j] = g[j], g[i] }
func (g GenSerGroups) Less(i, j int) bool { return g[i].MediaType < g[j].MediaType }
func (g GenSerGroups) Less(i, j int) bool { return g[i].Name < g[j].Name }
// GenSerGroup represents a group of serializers, most likely this is a media type to a list of
// prioritized serializers.
// GenSerGroup represents a group of serializers: this links a serializer to a list of
// prioritized media types (mime).
type GenSerGroup struct {
ReceiverName string
AppName string
Name string
MediaType string
Implementation string
GenSerializer
// All media types for this serializer. The redundant representation allows for easier use in templates
AllSerializers GenSerializers
}
@ -585,11 +603,12 @@ func (g GenSerializers) Less(i, j int) bool { return g[i].MediaType < g[j].Media
// GenSerializer represents a single serializer for a particular media type
type GenSerializer struct {
AppName string // Application name
ReceiverName string
AppName string
Name string
MediaType string
Implementation string
Name string // Name of the Producer/Consumer (e.g. json, yaml, txt, bin)
MediaType string // mime
Implementation string // func implementing the Producer/Consumer
Parameters []string // parameters supported by this serializer
}
// GenSecurityScheme represents a security scheme for code generation