bump(github.com/emicklei/go-restful):09691a3b6378b740595c1002f40c34dd5f218a22

This commit is contained in:
Clayton Coleman
2016-12-12 11:09:42 -05:00
parent 492f8d412f
commit c5f3784198
11 changed files with 95 additions and 41 deletions

View File

@@ -33,6 +33,21 @@ func (prop *ModelProperty) setMaximum(field reflect.StructField) {
func (prop *ModelProperty) setType(field reflect.StructField) {
if tag := field.Tag.Get("type"); tag != "" {
// Check if the first two characters of the type tag are
// intended to emulate slice/array behaviour.
//
// If type is intended to be a slice/array then add the
// overriden type to the array item instead of the main property
if len(tag) > 2 && tag[0:2] == "[]" {
pType := "array"
prop.Type = &pType
prop.Items = new(Item)
iType := tag[2:]
prop.Items.Type = &iType
return
}
prop.Type = &tag
}
}