mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 16:37:04 +08:00
Add v16.8.0
This commit is contained in:
8
vendor/github.com/swaggo/swag/schema.go
generated
vendored
8
vendor/github.com/swaggo/swag/schema.go
generated
vendored
@@ -26,6 +26,8 @@ const (
|
||||
STRING = "string"
|
||||
// FUNC represent a function value.
|
||||
FUNC = "func"
|
||||
// INTERFACE represent a interface value.
|
||||
INTERFACE = "interface{}"
|
||||
// ANY represent a any value.
|
||||
ANY = "any"
|
||||
// NIL represent a empty value.
|
||||
@@ -104,7 +106,8 @@ func IsGolangPrimitiveType(typeName string) bool {
|
||||
"float32",
|
||||
"float64",
|
||||
"bool",
|
||||
"string":
|
||||
"string",
|
||||
"any":
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -132,6 +135,7 @@ func TypeDocName(pkgName string, spec *ast.TypeSpec) string {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if spec.Name != nil {
|
||||
return fullTypeName(strings.Split(pkgName, ".")[0], spec.Name.Name)
|
||||
}
|
||||
@@ -167,6 +171,7 @@ func BuildCustomSchema(types []string) (*spec.Schema, error) {
|
||||
if len(types) == 1 {
|
||||
return nil, errors.New("need array item type after array")
|
||||
}
|
||||
|
||||
schema, err := BuildCustomSchema(types[1:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -177,6 +182,7 @@ func BuildCustomSchema(types []string) (*spec.Schema, error) {
|
||||
if len(types) == 1 {
|
||||
return PrimitiveSchema(types[0]), nil
|
||||
}
|
||||
|
||||
schema, err := BuildCustomSchema(types[1:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user