@@ -987,7 +987,7 @@ func buildResObj(params map[string]interface{}, parentKeys []string, key string,
987
987
if err != nil {
988
988
return nil , & ParseError {path : pathFromKeys (mapKeys ), Kind : KindInvalidFormat , Reason : fmt .Sprintf ("could not convert value map to array: %v" , err )}
989
989
}
990
- resultArr := make ([]interface {}, len (arr ))
990
+ resultArr := make ([]interface {} /*not 0,*/ , len (arr ))
991
991
for i := range arr {
992
992
r , err := buildResObj (params , mapKeys , strconv .Itoa (i ), schema .Value .Items )
993
993
if err != nil {
@@ -1096,9 +1096,9 @@ func handlePropParseError(path []string, err error) error {
1096
1096
}
1097
1097
1098
1098
func pathFromKeys (kk []string ) []interface {} {
1099
- path := make ([]interface {}, len (kk ))
1100
- for i , v := range kk {
1101
- path [ i ] = v
1099
+ path := make ([]interface {}, 0 , len (kk ))
1100
+ for _ , v := range kk {
1101
+ path = append ( path , v )
1102
1102
}
1103
1103
return path
1104
1104
}
@@ -1135,8 +1135,7 @@ func parsePrimitive(raw string, schema *openapi3.SchemaRef) (v interface{}, err
1135
1135
return nil , nil
1136
1136
}
1137
1137
for _ , typ := range schema .Value .Type .Slice () {
1138
- v , err = parsePrimitiveCase (raw , schema , typ )
1139
- if err == nil {
1138
+ if v , err = parsePrimitiveCase (raw , schema , typ ); err == nil {
1140
1139
return
1141
1140
}
1142
1141
}
0 commit comments