stricter swagger validation

This commit is contained in:
nikhiljindal 2015-07-27 17:29:46 -07:00
parent d63e35247f
commit 8cdd403d9d

View File

@ -123,10 +123,7 @@ func (s *SwaggerSchema) ValidateObject(obj interface{}, apiVersion, fieldName, t
for key, value := range fields { for key, value := range fields {
details, ok := properties.At(key) details, ok := properties.At(key)
if !ok { if !ok {
glog.Infof("unknown field: %s", key) allErrs = append(allErrs, fmt.Errorf("found invalid field %s for %s", key, typeName))
// Some properties can be missing because of
// https://github.com/GoogleCloudPlatform/kubernetes/issues/6842.
glog.Info("this may be a false alarm, see https://github.com/GoogleCloudPlatform/kubernetes/issues/6842")
continue continue
} }
if details.Type == nil && details.Ref == nil { if details.Type == nil && details.Ref == nil {