Skip to content

Commit f937147

Browse files
Compliance
1 parent b343c1d commit f937147

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

openapi3/schema.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,9 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
846846
if discriminatorVal, okcheck := valuemap[pn]; okcheck {
847847
if len(schema.Discriminator.Mapping) > 0 {
848848
if mapref, okcheck := schema.Discriminator.Mapping[discriminatorVal.(string)]; okcheck {
849-
for _, item := range v {
850-
if item.Ref == mapref {
851-
return item.Value.visitJSON(settings, value)
849+
for _, oneof := range v {
850+
if oneof.Ref == mapref {
851+
return oneof.Value.visitJSON(settings, value)
852852
}
853853
}
854854
}
@@ -857,9 +857,9 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
857857
``It is implied, that the property to which discriminator refers, contains the
858858
name of the target schema. In the example above, the objectType property should
859859
contain either simpleObject, or complexObject string.''*/
860-
for _, oneof := range schema.OneOf {
861-
if strings.HasSuffix(oneof.Ref, discriminatorVal.(string)) {
862-
return oneof.Value.visitJSON(settings, value)
860+
for _, v := range schema.OneOf {
861+
if strings.HasSuffix(v.Ref, discriminatorVal.(string)) {
862+
return v.Value.visitJSON(settings, value)
863863
}
864864
}
865865
}

0 commit comments

Comments
 (0)