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

Support encoding/decoding ByteArrays in parameterized types as ByteStrings. #2383

Closed
wants to merge 1 commit into from

Conversation

christiandeange
Copy link

This is effectively accomplished by propagating the value of
decodeByteArrayAsByteString, as determined by reading the annotations
on the element, down to any CborReaders for map- or list-like types.
Any ByteArray types listed as direct or indirect type argument for
these parameterized types will be parsed in the same manner.

Solves #2037.

This is effectively accomplished by propagating the value of
`decodeByteArrayAsByteString`, as determined by reading the annotations
on the element, down to any `CborReader`s for map- or list-like types.
Any `ByteArray` types listed as direct or indirect type argument for
these parameterized types will be parsed in the same manner.
christiandeange added a commit to christiandeange/ozone that referenced this pull request Aug 1, 2023
Subscription calls differ from query and procedure calls in that they
are actually subscriptions to a websocket, not a standard HTTP call. For
this reason, they actually respond with a `Flow<*>`, not just one value.

Part of the actual CBOR implementation in kotlinx-serialization is
adapted here to support byte arrays as byte strings for parameterized
types, like List<ByteArray>.

Kotlin/kotlinx.serialization#2383
@sandwwraith
Copy link
Member

Hi, am I correct that your decodeByteArrayAsByteString feature is the same as alwaysUseByteString from #2412?

@christiandeange
Copy link
Author

Yes if that PR is merged, I think this one is relatively redundant.

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