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
[Runtime] Design away EncodableBodyContent
### Motivation
Until #12 (Choose the serialization method based on content type), we were still looking for the right way to spell the various encoding/decoding methods that take into account both the type of the underlying schema, and the desired content type. In #12, we found something decent, but we could have simplified the spelling even further, getting rid of a whole closure invocation and a specialized type.
### Modifications
In this PR (in preparation for multiple content type support), we do the simplification by completely removing `EncodableBodyContent` and the associated closure trampoline that we used to propoagate the content type string. We now pass the string directly, and simplified all the helper functions that have to do with encoding body content.
Now, this is done in a backwards compatible way, so we really just deprecated all the existing methods, and the `EncodableBodyContent` type, but it'll all be cleaned up when we prepare for tagging the next breaking version.
### Result
The helper functions have a simpler spelling, which simplifies the generator and reduces the lines of code we have to generate.
(The associated generator PR will be coming in shortly.)
### Test Plan
I preserved all the tests for the deprecated variants, and added new unit tests for the new variants. The deprecated tests will also be cleaned up in the next breaking version.
Reviewed by: simonjbeaumont
Builds:
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (api breakage) - 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.
#30
0 commit comments