Skip to content

Commit

Permalink
Revert "Adds oneOf/discriminator/mapping management (getkin#321)"
Browse files Browse the repository at this point in the history
This reverts commit 1286d06.

# Conflicts:
#	openapi3filter/validation_discriminator_test.go

(cherry picked from commit a6bc0e1)
(cherry picked from commit 011aa82)
  • Loading branch information
riccardomanfrin committed Apr 21, 2021
1 parent 45d4919 commit be8af26
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions openapi3/schema.go
Expand Up @@ -867,19 +867,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val
err := v.visitJSON(settings, value)
settings.failfast = oldfailfast
if err == nil {
if schema.Discriminator != nil {
pn := schema.Discriminator.PropertyName
if valuemap, okcheck := value.(map[string]interface{}); okcheck {
if discriminatorVal, okcheck := valuemap[pn]; okcheck == true {
mapref, okcheck := schema.Discriminator.Mapping[discriminatorVal.(string)]
if okcheck && mapref == item.Ref {
ok++
}
}
}
} else {
ok++
}
ok++
}
}
if ok != 1 {
Expand Down

0 comments on commit be8af26

Please sign in to comment.