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

Full reflection-less encoding and schema generation #199

Closed
Chuckame opened this issue Apr 30, 2024 · 1 comment · Fixed by #214
Closed

Full reflection-less encoding and schema generation #199

Chuckame opened this issue Apr 30, 2024 · 1 comment · Fixed by #214
Labels
enhancement New feature or request
Milestone

Comments

@Chuckame
Copy link
Contributor

Chuckame commented Apr 30, 2024

Currently, in v2, we set a class using AvroSchema and AvroLogicalType annotations to be able to customize the final schemas and add logical types, but this requires kotlin reflection to allow creating the instance of the given class. In v1, we unwrap the nullable SerialDescriptors to get back the AvroDescriptor to access the custom methods for generating the schemas.

A PR has been done to be able of unwrapping a nullable descriptor, that now allows us to retrieve the original descriptor, so we can get rid of reflection for logical types and custom schemas, and it allows us to create brand new methods and interfaces on a standard SerialDescriptor.

This has been done here: Kotlin/kotlinx.serialization@c7bcaf1

When kotlin-serialization is released, avro4k v2 will be allowed to be released

@Chuckame Chuckame added the enhancement New feature or request label Apr 30, 2024
@Chuckame Chuckame added this to the Version 2 milestone Apr 30, 2024
@Chuckame Chuckame changed the title Take into account the next kotlinx serialization version Fully reflection-less May 3, 2024
@Chuckame Chuckame changed the title Fully reflection-less Full reflection-less encoding and schema generation May 3, 2024
@Chuckame Chuckame linked a pull request May 21, 2024 that will close this issue
@Chuckame
Copy link
Contributor Author

Released in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant