Skip to content

Commit

Permalink
Merge pull request #1330 from abemedia/patch-2
Browse files Browse the repository at this point in the history
feat: Support allOf additionalProperties merging if both are the equal
  • Loading branch information
tdakkota authored Oct 14, 2024
2 parents 23bc9d4 + 887f69a commit b72b870
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gen/schema_gen_sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,12 @@ func mergeSchemes(s1, s2 *jsonschema.Schema) (_ *jsonschema.Schema, err error) {
case s1.AdditionalProperties == nil && s2.AdditionalProperties != nil:
r.AdditionalProperties = s2.AdditionalProperties
r.Item = s2.Item
case reflect.DeepEqual(s1.AdditionalProperties, s2.AdditionalProperties):
r.AdditionalProperties = s1.AdditionalProperties
r.Item, err = mergeSchemes(s1.Item, s2.Item)
if err != nil {
return nil, errors.Wrap(err, "merge additionalProperties schema")
}
case s1.AdditionalProperties != nil && s2.AdditionalProperties != nil:
return nil, &ErrNotImplemented{Name: "allOf additionalProperties merging"}
}
Expand Down

0 comments on commit b72b870

Please sign in to comment.