close
The Wayback Machine - https://web.archive.org/web/20201117000200/https://github.com/Kotlin/kotlinx.serialization/issues/4
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

YAML? #4

Closed
nkiesel opened this issue Sep 23, 2017 · 2 comments
Closed

YAML? #4

nkiesel opened this issue Sep 23, 2017 · 2 comments

Comments

@nkiesel
Copy link

@nkiesel nkiesel commented Sep 23, 2017

Any plans for that?

Also I'm still trying to figure out why I would use this instead of Jackson. I guess x-platform is a big plus, but I'm currently using Kotlin exclusively on the server (i.e. JVM).

@sandwwraith
Copy link
Member

@sandwwraith sandwwraith commented Sep 24, 2017

We are not going to implement a lot of formats "out of the box", to keep runtime library small and easy-to-use. Instead, we try to encourage our users to write their own libraries for supporting different formats and build diverse ecosystem, because with serialization framework it become much easier. You can look at example project for JVM to find out how to write serializer which fits your needs (docs coming soon). If you publish a library which provides popular format for this framework, we'll include it in readme.

Regarding your second question: this serialization is reflection-less, so its main target are platforms on which Java Reflection API is unavailable or not desirable (Android, Kotlin/JS, Kotlin/Native). However, even on classic JVM targets you can obtain a huge performance improvement.

@nkiesel
Copy link
Author

@nkiesel nkiesel commented Sep 25, 2017

Thanks. Looking forward to the docs.

@nkiesel nkiesel closed this Sep 25, 2017
twyatt pushed a commit to JuulLabs/kotlinx.serialization that referenced this issue Jul 4, 2020
Pavel Vasin
twyatt added a commit to twyatt/kotlinx.serialization that referenced this issue Jul 28, 2020
* add ByteString serialization logic and tests (Kotlin#2)

* fix JS compilation error

* Moves ByteString to the CBOR package (Kotlin#3)

* moves ByteString type to the CBOR format package

and creates CBOR specific interfaces and abstract classes that extend the common Encoding/Decoding interfaces and classes.

* code clean up

* Abstract StructureKind BYTE_STRING:to VALUE_TYPE (Kotlin#4) (Kotlin#4)

* Use @ByteString annotation to toggle encoding/decoding of byte strings

This is a continuation of the Kotlin#846 effort,
whereas introducing a new `SerialKind` was discouraged:

Kotlin#846 (comment)

Instead, a dedicated annotation (`@ByteString`) is used to differentiate
`ByteArray` encoding/decoding between type 2 and type 4 (details re:
[Major types] are listed in RFC 7049).

[Major types]: https://tools.ietf.org/html/rfc7049#section-2.1

* Add basic documentation re: @ByteString annotation

* Unify String and ByteString implementations

* Minor documentation updates

* Fix decode indefinite test to use indefinite byte string

* Add missing comma in KDoc

* Clean up debugging

* Use @ByteString only for ByteArray

* Only use @ByteString for deserialization as well

* Micro optimization: short-circuit on boolean before object equality check

* Add link to cbor_byte_string.md document from general documentation

* CBOR additional information in hex notation

* Add comment stating that @ByteString only effects `ByteArray`

Co-authored-by: Christopher Corea <christopherc@juul.com>
Co-authored-by: Pavel Vasin <pavel@vasin.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.