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 JavaTimeModule #1065

Merged
merged 6 commits into from
Mar 20, 2025
Merged

Add JavaTimeModule #1065

merged 6 commits into from
Mar 20, 2025

Conversation

mcruzdev
Copy link
Contributor

@mcruzdev mcruzdev commented Jul 2, 2024

Description

Please explain the changes you've made

Issue reference

#995

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@mcruzdev mcruzdev force-pushed the issue-995 branch 2 times, most recently from 853f868 to 0c1886f Compare July 2, 2024 18:02
@cicoyle
Copy link
Contributor

cicoyle commented Jan 31, 2025

Ping @mcruzdev were you still working on this?

@mcruzdev
Copy link
Contributor Author

Hi @cicoyle to be sincerous no, but I would like to continue, do you think to get this one?

@mcruzdev mcruzdev marked this pull request as ready for review January 31, 2025 22:03
@mcruzdev mcruzdev requested review from a team as code owners January 31, 2025 22:03
@mcruzdev
Copy link
Contributor Author

I need to add tests and probably to upgrade the dependency version

@mcruzdev mcruzdev force-pushed the issue-995 branch 4 times, most recently from c633534 to d087fea Compare February 1, 2025 00:22
@mcruzdev
Copy link
Contributor Author

mcruzdev commented Feb 1, 2025

Hi @cicoyle, sorry for delay... I think this one solve the issue.

I tested calling the invokeMethod withouth JavaTimeModule and the error was reproduced.

@mcruzdev
Copy link
Contributor Author

Hi @cicoyle @salaboy, am I in the right path, WDYT?

@salaboy
Copy link
Contributor

salaboy commented Feb 21, 2025

@artursouza can you check this? I am not sure to have the full context to evaluate these changes.. but looking at the code it looks ok to me. Do we want to have that new dependency in the SDK? I am ok with it.

artur-ciocanu
artur-ciocanu previously approved these changes Feb 21, 2025
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcruzdev thank you for your contribution, it looks really good!

@artur-ciocanu artur-ciocanu self-requested a review February 27, 2025 23:05
@artur-ciocanu
Copy link
Contributor

@mcruzdev as I was thinking about your PR, it occurred to me that there could be a lot of other instances where we would like to register a custom Jackson module. My suggestion is to see how can we expand the ObjectSerializer API a little bit and maybe adding a ObjectSerializerFactory with two methods:

  • ObjectSerializerFactory.createDefaultSerializer() - this will create the default serializer that is currently used everywhere
  • ObjectSerializerFactory.createJacksonSerializer(ObjectMapper om) - this will be used to create a Jackson based serialized where we can customize the ObjectMapper and ensure we can add or remove all the necessary modules

CC: @cicoyle @artursouza

@mcruzdev
Copy link
Contributor Author

mcruzdev commented Mar 7, 2025

Good suggestions @artur-ciocanu TY, I will update the PR.

@mcruzdev
Copy link
Contributor Author

Hi @artur-ciocanu, could you take a new review?

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcruzdev thanks a lot for the updates, I have provided some additional comments, also I think it would make sense to provide some examples on how anyone could customize the serializers.

I think it would make sense to have a separate unit test for CustomizableObjectSerializer where we could show how one could customize the serializer and how ZonedDateTime would be serialized using Jackson JavaTimeModule

@artur-ciocanu artur-ciocanu self-requested a review March 16, 2025 17:55
@mcruzdev mcruzdev force-pushed the issue-995 branch 2 times, most recently from ab07e07 to 9f98ac2 Compare March 17, 2025 13:28
artur-ciocanu
artur-ciocanu previously approved these changes Mar 17, 2025
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcruzdev thanks for contribution, love it. I have left a few tiny comments.

@artur-ciocanu
Copy link
Contributor

@cicoyle and @salaboy could you also please take a look? Thank you.

@artur-ciocanu artur-ciocanu self-requested a review March 17, 2025 21:40
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job! 👍

@artur-ciocanu
Copy link
Contributor

@cicoyle I think this PR looks great and it is a good example on how anyone can extend the DaprObjectSerializer to add other Jackson modules, this was a huge pain in the past.

Could you please review and approve. Thank you!

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for CI

@artur-ciocanu
Copy link
Contributor

@cicoyle could you please approve this PR. Thank you.

Copy link
Contributor

@salaboy salaboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! thanks @mcruzdev !

@salaboy
Copy link
Contributor

salaboy commented Mar 19, 2025

retriggering CI but this is ready to be merged @cicoyle

@artur-ciocanu
Copy link
Contributor

@cicoyle could you please approve and merge this PR. Thank you.

@cicoyle cicoyle merged commit ffbb5b3 into dapr:master Mar 20, 2025
7 checks passed
@cicoyle
Copy link
Contributor

cicoyle commented Mar 20, 2025

Thanks @mcruzdev 🎉

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

Successfully merging this pull request may close these issues.

4 participants