Skip to content

Commit

Permalink
flatten nested allOfs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhostettler committed Jun 5, 2024
1 parent 231b6c9 commit c942f86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jsonschema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func schemaFromFile(schemaPath string, oneOfType string, flatten bool) (*Schema,
if s.Items == nil {
s.Items = one.Items
}
if flatten {
for _, a := range one.AllOf {
s.Properties = mergeProperties(s.Properties, a.Properties)
s.Required = append(s.Required, a.Required...)
}
}
}

return &s, nil
Expand Down

0 comments on commit c942f86

Please sign in to comment.