Skip to content

Commit

Permalink
Merge pull request #312 from deads2k/allow-empty-discriminator
Browse files Browse the repository at this point in the history
Allow union without any fields-to-discriminateBy
  • Loading branch information
k8s-ci-robot authored Nov 29, 2023
2 parents 778a556 + 78a2dba commit f0671cc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/schemaconv/smd.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ func makeUnion(extensions map[string]interface{}) (schema.Union, error) {
}
}

if union.Discriminator != nil && len(union.Fields) == 0 {
return schema.Union{}, fmt.Errorf("discriminator set to %v, but no fields in union", *union.Discriminator)
}
return union, nil
}

Expand Down

0 comments on commit f0671cc

Please sign in to comment.