Skip to content

fix: Preserve native types for multivariate feature option values#205

Merged
matthewelwell merged 3 commits intoFlagsmith:mainfrom
maxkomarychev:max/java-multivar
Apr 2, 2026
Merged

fix: Preserve native types for multivariate feature option values#205
matthewelwell merged 3 commits intoFlagsmith:mainfrom
maxkomarychev:max/java-multivar

Conversation

@maxkomarychev
Copy link
Copy Markdown
Contributor

MultivariateFeatureOptionModel.value was typed as String, causing Jackson to coerce boolean and integer JSON values to their string representations (e.g. true -> "true", 42 -> "42") during deserialization of the environment document.

This affected only the local evaluation path where multivariate variant values flow through EngineMappers into the flag engine. The control value (feature_state_value) was unaffected because FeatureStateModel already uses Object for its value field.

Changing the field type to Object lets Jackson preserve the original JSON type through the entire evaluation pipeline.

MultivariateFeatureOptionModel.value was typed as String, causing
Jackson to coerce boolean and integer JSON values to their string
representations (e.g. true -> "true", 42 -> "42") during
deserialization of the environment document.

This affected only the local evaluation path where multivariate
variant values flow through EngineMappers into the flag engine.
The control value (feature_state_value) was unaffected because
FeatureStateModel already uses Object for its value field.

Changing the field type to Object lets Jackson preserve the
original JSON type through the entire evaluation pipeline.
@maxkomarychev maxkomarychev requested a review from a team as a code owner April 1, 2026 21:38
@maxkomarychev maxkomarychev requested review from Zaimwa9 and removed request for a team April 1, 2026 21:38
khvn26
khvn26 previously approved these changes Apr 1, 2026
Copy link
Copy Markdown
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

This reverts commit 342ac23.
@matthewelwell matthewelwell merged commit b144bb0 into Flagsmith:main Apr 2, 2026
13 checks passed
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.

3 participants