Skip to content

Commit

Permalink
fix: re-implement flattening that we can do with a single protobuf on…
Browse files Browse the repository at this point in the history
…eOf field
  • Loading branch information
sudorandom committed Jan 31, 2025
1 parent ee6e8b3 commit 7436de3
Show file tree
Hide file tree
Showing 17 changed files with 641 additions and 712 deletions.
6 changes: 5 additions & 1 deletion internal/converter/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ func MessageToSchema(opts options.Options, tt protoreflect.MessageDescriptor) (s
slices.Sort(items)
allOfs = append(allOfs, makeOneOfGroup(items))
}
s.AllOf = append(s.AllOf, allOfs...)
if len(allOfs) == 1 {
s.AnyOf = allOfs[0].Schema().AnyOf
} else {
s.AllOf = append(s.AllOf, allOfs...)
}
}

// Apply Updates from Options
Expand Down
Loading

0 comments on commit 7436de3

Please sign in to comment.