Skip to content

Commit

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

# Conflicts:
#	openapi3filter/validation_discriminator_test.go
  • Loading branch information
riccardomanfrin committed Apr 13, 2021
1 parent c38c063 commit 9c63c16
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions openapi3/schema.go
Original file line number Diff line number Diff line change
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 9c63c16

Please sign in to comment.