Skip to content

Commit

Permalink
Cleaner [I'll squash this later]
Browse files Browse the repository at this point in the history
(cherry picked from commit 1b40d29)
(cherry picked from commit f4f135f)
  • Loading branch information
riccardomanfrin committed Apr 21, 2021
1 parent 146d4b9 commit b343c1d
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 b343c1d

Please sign in to comment.