Skip to content

Commit

Permalink
Cleaner [I'll squash this later]
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardomanfrin committed Apr 13, 2021
1 parent 2297b20 commit d045603
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions openapi3/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
name of the target schema. In the example above, the objectType property should
contain either simpleObject, or complexObject string.''*/
for _, oneof := range schema.OneOf {
/* TODO: ugly.. should this be a property of the SchemaRef? */
objectType := strings.ReplaceAll(oneof.Ref, "#/components/schemas/", "")
if objectType == discriminatorVal {
if strings.HasSuffix(oneof.Ref, discriminatorVal.(string)) {
return oneof.Value.visitJSON(settings, value)
}
}
Expand Down

0 comments on commit d045603

Please sign in to comment.