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

Iterable Binary return type inconsistent with other binary types #194

Open
AdamDeHovitz opened this issue Mar 17, 2021 · 2 comments
Open

Comments

@AdamDeHovitz
Copy link
Contributor

AdamDeHovitz commented Mar 17, 2021

Unlike with other return types, conjure-go special cases binary endpoints to use the ReadCloser stream type rather than the default []byte. Specifically, endpoints that return binary use ReadCloser while optional<binary> endpoints will return *ReadCloser after the resolution of #192. In contrast endpoints with either a set<binary> or list<binary> type use an unstreamable [][]byte go type. Ultimately this might be the right choice but we should compare the implementation against conjure-java, validate that this type works, and add unit/integration testing to guarantee this behavior.

@AdamDeHovitz
Copy link
Contributor Author

I did some testing in java and found the following type conversions from conjure to java:
binary -> BinaryResponseBody
optional<binary> -> Optional<BinaryResponseBody>
list<binary> -> List<ByteBuffer

@gregakinman
Copy link

@AdamDeHovitz List<ByteBuffer> doesn't look like streaming to me, so at first glance it looks like this is consistent with the Java implementation, but I'm not 100% sure

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

No branches or pull requests

2 participants