@@ -841,14 +841,14 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
841
841
842
842
if schema .Discriminator != nil {
843
843
/* Find mapped object by ref */
844
- if valuemap , okcheck := value .(map [string ]interface {} ); okcheck {
844
+ if valuemap , okcheck := value .(map [string ]string ); okcheck {
845
845
pn := schema .Discriminator .PropertyName
846
846
if discriminatorVal , okcheck := valuemap [pn ]; okcheck {
847
847
if len (schema .Discriminator .Mapping ) > 0 {
848
- 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 )
848
+ if mapref , okcheck := schema .Discriminator .Mapping [discriminatorVal ]; okcheck {
849
+ for _ , oneof := range v {
850
+ if oneof .Ref == mapref {
851
+ return oneof .Value .visitJSON (settings , value )
852
852
}
853
853
}
854
854
}
@@ -857,9 +857,9 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
857
857
``It is implied, that the property to which discriminator refers, contains the
858
858
name of the target schema. In the example above, the objectType property should
859
859
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 ) {
862
+ return v .Value .visitJSON (settings , value )
863
863
}
864
864
}
865
865
}
0 commit comments