mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Pick up the latest updates to go-restful.
This commit is contained in:
parent
37689038d2
commit
f826bf6b46
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -170,8 +170,8 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/emicklei/go-restful",
|
||||
"Comment": "v1.1.3-29-gc68bc68",
|
||||
"Rev": "c68bc68d7689f127ab554a42378aece0ea3df4b3"
|
||||
"Comment": "v1.1.3-34-g5e1952e",
|
||||
"Rev": "5e1952ed0806503c059e4463c2654200660f484b"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
|
14
Godeps/_workspace/src/github.com/emicklei/go-restful/swagger/model_builder.go
generated
vendored
14
Godeps/_workspace/src/github.com/emicklei/go-restful/swagger/model_builder.go
generated
vendored
@ -106,6 +106,15 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod
|
||||
return b.buildArrayTypeProperty(field, jsonName, modelName)
|
||||
case fieldKind == reflect.Ptr:
|
||||
return b.buildPointerTypeProperty(field, jsonName, modelName)
|
||||
case fieldKind == reflect.String:
|
||||
stringt := "string"
|
||||
prop.Type = &stringt
|
||||
return jsonName, prop
|
||||
case fieldKind == reflect.Map:
|
||||
// if it's a map, it's unstructured, and swagger 1.2 can't handle it
|
||||
anyt := "any"
|
||||
prop.Type = &anyt
|
||||
return jsonName, prop
|
||||
}
|
||||
|
||||
if b.isPrimitiveType(fieldType.String()) {
|
||||
@ -155,6 +164,10 @@ func (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonNam
|
||||
if required {
|
||||
model.Required = append(model.Required, k)
|
||||
}
|
||||
// Add the model type to the global model list
|
||||
if v.Ref != nil {
|
||||
b.Models[*v.Ref] = sub.Models[*v.Ref]
|
||||
}
|
||||
}
|
||||
// empty name signals skip property
|
||||
return "", prop
|
||||
@ -258,6 +271,7 @@ func (b modelBuilder) jsonSchemaType(modelName string) string {
|
||||
"int": "integer",
|
||||
"int32": "integer",
|
||||
"int64": "integer",
|
||||
"uint64": "integer",
|
||||
"byte": "string",
|
||||
"float64": "number",
|
||||
"float32": "number",
|
||||
|
Loading…
Reference in New Issue
Block a user