feat: convert buffers to base64 for json contentType #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds conversion functions for all generated types which handles
[]const u8
data and encodes/decodes base64 before passing back and forth across the wasm boundary.Of note: all schema types now have
__decodeBase64Fields
and__encodeBase64Fields
public methods. I couldn't get private methods to work, since we import these types around the generated code... if anyone has ideas of how to improve this, or make it more clear via naming that these shouldn't really be called, let me know!I thought of
XXX__decodeBase64Fields
or something along those lines, which I think protobuf does in Go for example... and would be open to it. But it's a little jarring IMO to see these in your autocomplete etc. Maybe its more clear?CI likely fails until we merge & release dylibso/xtp-bindgen-test#10