Skip to content

Commit ec7fb03

Browse files
committed
fixed #192
1 parent 35bf259 commit ec7fb03

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

parameters/validate_parameter.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"net/url"
1010
"reflect"
1111
"strings"
12-
"sync"
1312

1413
"github.com/pb33f/libopenapi/datamodel/high/base"
1514
"github.com/pb33f/libopenapi/utils"
@@ -264,24 +263,17 @@ func formatJsonSchemaValidationError(schema *base.Schema, scErrs *jsonschema.Val
264263
}
265264
}
266265
}
267-
processPoly := func(schemas []*base.SchemaProxy, wg *sync.WaitGroup) {
268-
if len(schemas) > 0 {
269-
for _, s := range schemas {
270-
extractTypes(s)
271-
}
266+
processPoly := func(schemas []*base.SchemaProxy) {
267+
for _, s := range schemas {
268+
extractTypes(s)
272269
}
273-
wg.Done()
274270
}
275271

276272
// check if there is polymorphism going on here.
277273
if len(schema.AnyOf) > 0 || len(schema.AllOf) > 0 || len(schema.OneOf) > 0 {
278-
279-
wg := sync.WaitGroup{}
280-
wg.Add(3)
281-
go processPoly(schema.AnyOf, &wg)
282-
go processPoly(schema.AllOf, &wg)
283-
go processPoly(schema.OneOf, &wg)
284-
wg.Wait()
274+
processPoly(schema.AnyOf)
275+
processPoly(schema.AllOf)
276+
processPoly(schema.OneOf)
285277

286278
sep := "or"
287279
if len(schema.AllOf) > 0 {

0 commit comments

Comments
 (0)