You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] Fix multipart schema inference for allOf/anyOf/oneOf of primitive types and non-binary arrays (#391)
[Bug] Fix multipart schema inference for allOf/anyOf/oneOf of primitive types and non-binary arrays
### Motivation
As I started testing the multipart generation on real-world projects, I discovered two bugs:
- allOf/anyOf/oneOf of primitive types (such as string) were encoded as JSON instead of a raw string (aka HTTPBody), which was wrong
- arrays of non-binary and arrays of binary elements were treated inconsistently
### Modifications
Fixed the bug by refactoring the inferrence logic a bit.
### Result
Now e.g. an anyOf of a string still gets encoded as a primitive type, not JSON.
### Test Plan
Added a unit test for this logic with a few test cases, easier to debug this way.
Reviewed by: simonjbeaumont
Builds:
✔︎ pull request validation (5.10) - Build finished.
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (compatibility test) - Build finished.
✔︎ pull request validation (docc test) - Build finished.
✔︎ pull request validation (integration test) - Build finished.
✔︎ pull request validation (nightly) - Build finished.
✔︎ pull request validation (soundness) - Build finished.
#391
0 commit comments