Skip to content

Commit

Permalink
fix(gen): update generator due to schema parser changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Nov 16, 2022
1 parent 4312761 commit 1c1f8cf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gen/schema_gen_sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,12 @@ func (g *schemaGen) oneOf(name string, schema *jsonschema.Schema) (*ir.Type, err
if !s.Is(ir.KindStruct, ir.KindMap) {
return nil, errors.Wrapf(&ErrNotImplemented{"unsupported sum type variant"}, "%q", s.Kind)
}
var ref string
if s.Schema != nil {
ref = s.Schema.Ref
} else {
ref = schema.OneOf[i].Ref
vschema := s.Schema
if vschema == nil {
vschema = schema.OneOf[i]
}

if ref == v || path.Base(ref) == v {
if vschema == v {
found = true
sum.SumSpec.Mapping = append(sum.SumSpec.Mapping, ir.SumSpecMap{
Key: k,
Expand Down

0 comments on commit 1c1f8cf

Please sign in to comment.