Add field-level amount representation for Joda-Money (@JodaMoney annotation) - #76
Merged
cowtowncoder merged 7 commits intoOct 25, 2025
Conversation
Implements per-property override of amount representation to complement the module-level default introduced in PR FasterXML#17. Changes: - Add DEFAULT value to AmountRepresentation enum to represent "inherit module config" - Add @jsonmoney annotation for field-level configuration - Make MoneySerializer and MoneyDeserializer contextual to support per-property resolution - Support @jsonformat(shape=...) mapping: STRINGâDECIMAL_STRING, NUMBER/NUMBER_FLOATâDECIMAL_NUMBER, NUMBER_INTâMINOR_CURRENCY_UNIT - Precedence: @jsonmoney > @jsonformat > module default > built-in default - Full mix-in support via Jackson's standard BeanProperty API - Maintain backward compatibility for unannotated fields Tests: - Add MoneyFieldLevelRepresentationTest with 12 tests covering field/getter/constructor annotations, mixed configurations, precedence, and mix-ins - Add MoneyFormatShapeMappingTest with 9 tests covering shape mappings and multiple fields - All 94 tests pass (21 new, 73 existing with no regression) Fixes FasterXML#18 ðĪ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
âĶfield-level-amount-representation
- Update package structure from com.fasterxml.jackson to tools.jackson - Adapt MoneySerializer for Jackson 3.x API (SerializationContext, JacksonException) - Adapt MoneyDeserializer for Jackson 3.x API - Update JsonMoney annotation package - Update test files package declarations and imports - Maintain field-level amount representation feature compatibility ðĪ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Jackson 3.x API compatibility: use MapperBuilder.addMixIn() instead of ObjectMapper.addMixIn() - Replace AssertJ assertions with JUnit assertions (assertTrue, assertEquals) - Fix import statements to use correct Jackson 3.x package names - Update MoneySerializer and MoneyDeserializer to implement contextual serialization ðĪ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
cowtowncoder
left a comment
Member
There was a problem hiding this comment.
Looks reasonable; couple of changes needed but nothing major. Can go in 3.1.0 (API addition with new enum type).
Member
|
@sri-adarsh-kumar we have CCLA for Zalando so you would be covered, right? If so, no need for individual CLA. |
Renamed the @jsonmoney annotation to @JodaMoney for better alignment with the module naming convention. This change updates: - Annotation interface name from JsonMoney to JodaMoney - All references in serializer and deserializer classes - All test cases and documentation examples ðĪ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
sri-adarsh-kumar
marked this pull request as ready for review
October 22, 2025 18:07
Member
|
Looks good, will try to do proper review soon, to merge in 3.x for 3.1.0 |
| * | ||
| * @see AmountRepresentation | ||
| * @see JodaMoneyModule#withAmountRepresentation(AmountRepresentation) | ||
| */ |
cowtowncoder
approved these changes
Oct 25, 2025
cowtowncoder
left a comment
Member
There was a problem hiding this comment.
LGTM -- I can add missing @since annotations.
@JodaMoney annotation)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements per-property override of amount representation to complement the module-level default introduced in PR #17.
Changes:
Tests:
Fixes #18
ðĪ Generated with Claude Code