java-sdk
java-sdk copied to clipboard
[Proposal] New project to handle JSON serialization
The core SDK does not provide solutions for serialization of application domain objects, it only offers an interface. In order to enable applications to opt-in to specific serialization solutions, it might be better to expose as an optional project (similar to how it is done in Spring Boot).
This proposal is to create a new project for JSON serialization that apps can opt in and be extensible, so it can be configured to handle specific scenarios unique for each app. This package should be specific per vendor, which means a different JSON serializer should be done in a separate project.
This new project would also not be opinionated (but customizable) in how data types are serialized. Like DateTime, for example.
We can start with dapr-jackson project, where it uses the Jackson serializer. Possible names:
dapr-jacksondapr-serialization-jacksondapr-serialize-jackson
Open questions
- How would apps implement their own versioning logic on top of this serializer?
It's an interesting idea. But I think that it should be a group of projects. For example, a common project dapr-serialization with common modules. And then dapr-serialization-jackson, dapr-serialization-jsoniter and other.
@abogdanov37 What would be in dapr-serialization? I wonder if it is something already present in dapr-sdk.
totally agree, we have run into many dependencies issues caused by the hard dependency of jackson, you can find more here https://github.com/Azure/azure-sdk-for-java/issues?q=is%3Aissue+jackson, and azure sdk is planning to remove it https://github.com/Azure/azure-sdk-for-java/issues/24480
meanwhile, you may also consider this https://github.com/Azure/azure-sdk-for-java/issues/24530