forked from Kotlin/kotlinx.serialization
-
Notifications
You must be signed in to change notification settings - Fork 0
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
CBOR: Basic Support for Tags #1
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12a139c
to
f3f5976
Compare
f3f5976
to
9fcebf9
Compare
nodh
requested changes
Jul 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, but small changes requested
formats/cbor/commonMain/src/kotlinx/serialization/cbor/ValueTags.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonMain/src/kotlinx/serialization/cbor/ValueTags.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonMain/src/kotlinx/serialization/cbor/ValueTags.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonMain/src/kotlinx/serialization/cbor/ValueTags.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonMain/src/kotlinx/serialization/cbor/ValueTags.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonTest/src/kotlinx/serialization/cbor/CborReaderTest.kt
Outdated
Show resolved
Hide resolved
formats/cbor/commonTest/src/kotlinx/serialization/cbor/SampleClasses.kt
Outdated
Show resolved
Hide resolved
nodh
reviewed
Jul 10, 2023
formats/cbor/commonMain/src/kotlinx/serialization/cbor/internal/Encoding.kt
Outdated
Show resolved
Hide resolved
submitting to upstream |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduces basic support for CBOR tags.
Basic means that no semantic checks are performed yet, so you freely use reserved tags (e.g. serialize a cornucopia of fruit and other produce using tags reserved for dates, URIs, MIME messages, negative bignums and so forth) and no error will be thrown.
ValueTags
andKeyTags
to specify tags for keys and values, respectivelyCbor
class (names are self-explanatory):writeKeyTags
writeValueTags
verifyKeyTags
verifyValueTags
This is the first PR in a series of planned enhancements, but we still consider it valuable on its own (as it also affects Kotlin#1560).
In the long run, we plan to support semantically correct serialization for all reserved CBOR tags. This includes separate contributions to koltinx.datetime and the native support for self-describing CBOR. The latter of which is planned to enable the deserialization of CBOR structures, while also enabling access to the original underlying raw byte-string. This is a crucial features for conveniently working with (i.e. verifying) signed data. (Which, in turn, is a requirement for a 100% pure Kotlin multiplatform COSE implementation.)
Hence, we want to use this opportunity to also collect early feedback from those who are more familiar with kotlinx.serialization than we are.