Skip to content

test case for serializing custom numbers with config overrides #5198

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

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from

Conversation

pjfanning
Copy link
Member

@pjfanning pjfanning commented Jun 18, 2025

  • relates to a broken test in jackson-module-scala - Create NumberSerializerTest.scala jackson-module-scala#748 - that 748 test basically works with Jackson 2 (and is merged in jackson-module-scala 2.x branch)
  • Scala has scala.math.BigDecimal which is a wrapper on java.math.BigDecimal but we don't want test cases in jackson-databind that bring in outside dependencies. The MyBigDecimal class in this PR is enough to trigger the issue
  • of the 2 unit tests, the BigDecimal one already works but the MyBigDecimal one fails
  • I did a little debugging and the code in BasicSerializerFactory.java to check the config overrides has changed quite a bit in Jackson 3 and the changes cause this test case to fail

@@ -161,6 +161,9 @@ public ValueSerializer<Object> createSerializer(SerializationContext ctxt, JavaT
beanDescRef = ctxt.lazyIntrospectBeanDescription(type);
}
}
if (formatOverrides == null) {
Copy link
Member

Choose a reason for hiding this comment

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

This seems like patching a bug further upstream? I'll have to think about this bit more -- after vacation (going on vacation today), so it'll be some time until I get back, but will go through it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues to be only tackled for Jackson 3.x, not 2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants