go.mod: Update oapi-codegen and kin-openapi
This commit is contained in:
parent
add17bba45
commit
a83cf95d5b
156 changed files with 29663 additions and 2248 deletions
30
vendor/github.com/deepmap/oapi-codegen/pkg/codegen/extension.go
generated
vendored
30
vendor/github.com/deepmap/oapi-codegen/pkg/codegen/extension.go
generated
vendored
|
|
@ -8,7 +8,9 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
extPropGoType = "x-go-type"
|
||||
extPropGoType = "x-go-type"
|
||||
extPropOmitEmpty = "x-omitempty"
|
||||
extPropExtraTags = "x-oapi-codegen-extra-tags"
|
||||
)
|
||||
|
||||
func extTypeName(extPropValue interface{}) (string, error) {
|
||||
|
|
@ -23,3 +25,29 @@ func extTypeName(extPropValue interface{}) (string, error) {
|
|||
|
||||
return name, nil
|
||||
}
|
||||
|
||||
func extParseOmitEmpty(extPropValue interface{}) (bool, error) {
|
||||
raw, ok := extPropValue.(json.RawMessage)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("failed to convert type: %T", extPropValue)
|
||||
}
|
||||
|
||||
var omitEmpty bool
|
||||
if err := json.Unmarshal(raw, &omitEmpty); err != nil {
|
||||
return false, errors.Wrap(err, "failed to unmarshal json")
|
||||
}
|
||||
|
||||
return omitEmpty, nil
|
||||
}
|
||||
|
||||
func extExtraTags(extPropValue interface{}) (map[string]string, error) {
|
||||
raw, ok := extPropValue.(json.RawMessage)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to convert type: %T", extPropValue)
|
||||
}
|
||||
var tags map[string]string
|
||||
if err := json.Unmarshal(raw, &tags); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal json")
|
||||
}
|
||||
return tags, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue