Skip to content

Commit

Permalink
Merge pull request #1148 from utherbit/fixgen
Browse files Browse the repository at this point in the history
fix(gen): detect conflict when generic is not of the same base type
  • Loading branch information
ernado authored Jan 2, 2024
2 parents 67c195f + 00bf96b commit 9be9cf9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gen/schema_gen_sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,9 @@ func (g *schemaGen) allOf(name string, schema *jsonschema.Schema) (*ir.Type, err
return nil, err
}

// Do not modify reference fields, as they may still refer to the original schema.
if mergedSchema.Ref.IsZero() {
mergedSchema.Ref = schema.Ref
}
// The reference field must not change
mergedSchema.Ref = schema.Ref

return g.generate(name, mergedSchema, false)
}

Expand Down

0 comments on commit 9be9cf9

Please sign in to comment.