-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add config option for Decimal128 representation of numerics. #4916
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
Conversation
@@ -154,11 +161,18 @@ public static class MongoConverterConfigurationAdapter { | |||
private static final Set<Class<?>> JAVA_DRIVER_TIME_SIMPLE_TYPES = Set.of(LocalDate.class, LocalTime.class, LocalDateTime.class); | |||
|
|||
private boolean useNativeDriverJavaTimeCodecs = false; | |||
private String numericFormat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, either that or a flag like the native driver codecs.
private final List<Object> customConverters = new ArrayList<>(); | ||
|
||
private final PropertyValueConversions internalValueConversion = PropertyValueConversions.simple(it -> {}); | ||
private PropertyValueConversions propertyValueConversions = internalValueConversion; | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not introduce Environment
lookups here. Ideally, Spring Boot is an entry point for these config values so that we can remain clear of any configuration concerns.
We now allow configuring the default representation for BigDecimal and BigInteger values, still defaulting to string. BigDecimal can be configured to use Decimal128 by default.
Refine documentation. Simplify NumberToNumberConverter. Replace Environment-based configuration with config API.
That's merged and polished now. |
This PR moves some of the statically configured conversions into more dynamic spot. This now allows to access environment and manual config options when registering numeric converters like those for
BigInteger
&BigDecimal
.Still a draft as this one might not be side effect free.
Closes: #3444