-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for Kotlin serialization #47
Comments
@raderio is there something that would prevent you from using this? I haven't looked into it that closely yet, but I'm not certain we would be able to easily accommodate this in the internals of micronaut-core, as we want to support Java and Groovy as well, so Jackson's interoperability on all the JVM languages makes the most sense to use. Can you provide more detail as to what "supporting" kotlin serialization would look like? Nothing should prevent you from using this yourself in your application code that I'm aware of. |
If a module were to be built or contributed think it makes more sense here |
@raderio Any follow-up on this request? |
Only as info, Spring will support kotlinx.serialization as an alternative to Jackson:
I think that many Kotlin users would be happy with a similar solution in Micronaut as well ;) |
An extra plus for this implementation would be support for kotlin's |
Oh yes! This is my primary reason for preferring kotlinx serialization over any other library. Moreover, it is a bit faster thanks to build-time source code generation (which is also preferred by Micronaut). I really hate when there are two UUIDs in a function argument, and someone calls it with the wrong order, and it still compiles. A UserId is not an AccountId. Yes, both are represented by UUIDs, but who cares? I have just started learning Micronaut. I plan to migrate from Spring Boot and use the native runtime. (In theory, Spring supports native builds too, but at the end of the day, it just doesn't work... There's always some forgotten reflection somewhere... So, I have to run tests on the JVM, collect reflection/proxy data, recompile it with the collected info, and then test it again... lol. No way. Who has time to wait for that?) In Spring Boot, there is a springdoc library that generates the OpenAPI YAML, but it only supports FasterXML Jackson. Yes, I can switch to kotlinx serialization, but then the generated OpenAPI will be inconsistent. This is an open issue in springdoc. I think it could be problematic here too. |
https://github.com/Kotlin/kotlinx.serialization
Kotlin cross-platform / multi-format reflectionless serialization.
Kotlin serialization consists of a compiler plugin, which automatically produces visitor code for classes, and runtime library, which uses generated code to serialize objects without reflection.
The text was updated successfully, but these errors were encountered: