Skip to content

Commit

Permalink
fix(gen): detect conflict when generic is not of the same base type
Browse files Browse the repository at this point in the history
  • Loading branch information
utherbit committed Dec 27, 2023
1 parent 59ac09f commit 28bd97e
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 28bd97e

Please sign in to comment.