Revert "Update go-restful to get stable sorting in spec"

This commit is contained in:
Tim Hockin
2015-05-28 16:04:11 -07:00
parent d639005422
commit 4a7071e7f7
25 changed files with 177 additions and 535 deletions

View File

@@ -85,12 +85,12 @@ func (s *SwaggerSchema) ValidateBytes(data []byte) error {
func (s *SwaggerSchema) ValidateObject(obj interface{}, apiVersion, fieldName, typeName string) error {
models := s.api.Models
// TODO: handle required fields here too.
model, ok := models.At(typeName)
model, ok := models[typeName]
if !ok {
return fmt.Errorf("couldn't find type: %s", typeName)
}
properties := model.Properties
if len(properties.List) == 0 {
if len(properties) == 0 {
// The object does not have any sub-fields.
return nil
}
@@ -102,7 +102,7 @@ func (s *SwaggerSchema) ValidateObject(obj interface{}, apiVersion, fieldName, t
fieldName = fieldName + "."
}
for key, value := range fields {
details, ok := properties.At(key)
details, ok := properties[key]
if !ok {
glog.Infof("unknown field: %s", key)
// Some properties can be missing because of