Skip to content

Commit

Permalink
docs: improve error message
Browse files Browse the repository at this point in the history
Especially now these could be a number of different incompatible types,
we should report this to the user.
  • Loading branch information
jamietanna committed Jun 3, 2024
1 parent 119a521 commit 9429f76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/codegen/merge_schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func mergeOpenapiSchemas(s1, s2 openapi3.Schema, allOf bool) (openapi3.Schema, e
result.AllOf = append(s1.AllOf, s2.AllOf...)

if s1.Type.Slice() != nil && s2.Type.Slice() != nil && !equalTypes(s1.Type, s2.Type) {
return openapi3.Schema{}, errors.New("can not merge incompatible types")
return openapi3.Schema{}, fmt.Errorf("can not merge incompatible types: %v, %v", s1.Type.Slice(), s2.Type.Slice())
}
result.Type = s1.Type

Expand Down

0 comments on commit 9429f76

Please sign in to comment.