Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert buffers to base64 for json contentType #4

Merged
merged 3 commits into from
Sep 12, 2024
Merged

Conversation

nilslice
Copy link
Member

@nilslice nilslice commented Sep 11, 2024

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

@nilslice nilslice merged commit 187397c into main Sep 12, 2024
1 check passed
@nilslice nilslice deleted the json-buffer branch September 12, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants