@@ -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