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

Add kotlin.serialization implementation of Serializer #121

Closed
wants to merge 1 commit into from
Closed

Add kotlin.serialization implementation of Serializer #121

wants to merge 1 commit into from

Conversation

hiddewie
Copy link
Contributor

@hiddewie hiddewie commented May 23, 2021

This PR adds support for Kotlin serialization, see issue #13.

This PR includes #120 (this is required in order to use the stable version of kotlin.serialization).

In summary:

  • Adds a class KotlinSerializer which implements Axon Serializer.
  • Configurable RevisionResolver, Converter, and Json, with the same defaults as the Jackson serializer implementation.
  • Because Json is configurable, applications can define how JSON should be serialized based on business requirements.
  • Adds a DSL function kotlinSerializer to create a KotlinSerializer with configuration options.
  • Useful errors when the .serializer() method cannot be found on a companion object of a to-serialize object.
  • Class -> KSerializer is cached for performance and to avoid too much reflection.
  • Simple test to show that the implementation works.

Ref https://kotlinlang.org/docs/serialization.html with basic overview.
Ref https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serialization-guide.md with serialization guide.

@sonarcloud
Copy link

sonarcloud bot commented May 23, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sandjelkovic
Copy link
Member

Hey @hiddewie, thanks for this PR! There are a couple of things that should be changed but otherwise looks good

@hiddewie
Copy link
Contributor Author

I had to recreate the PR in #124 because I deleted by Github fork, and when I re-forked this PR could still not be updated...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants