Skip to content

fix: handles integer foreign-key priority#215

Merged
Zaimwa9 merged 1 commit intomainfrom
fix/feature-segment-deserialization
May 8, 2026
Merged

fix: handles integer foreign-key priority#215
Zaimwa9 merged 1 commit intomainfrom
fix/feature-segment-deserialization

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented May 8, 2026

Closes #214 , restoring previous behavior

  • Fixes MismatchedInputException thrown by SDK 8.0.0–8.1.0 when deserializing /api/v1/identities/ responses from self-hosted Core/EE that include a flag with a segment override.

  • Root cause: PR feat!: Context Values support, getEvaluationResult #184 dropped the FeatureSegmentModel(Integer) constructor that Jackson was using as a delegating creator to coerce Core/EE's integer FK shape (feature_segment: 321) into the model. Edge emits feature_segment: {"priority": <int>} and is unaffected.

  • Restores the Integer-arg constructor (mirrors pre-feat!: Context Values support, getEvaluationResult #184 shape) so both wire formats deserialize correctly.

  • SaaS / edge.api.flagsmith.com users were never affected.

  • Core/EE wire-format inconsistency is the deeper issue and will be tracked separately — the SDK still needs this tolerance long-term to support older self-hosted installs.

    Test plan

  • Added FeatureSegmentModelTest covering the three shapes: integer FK (Core/EE), engine object (Edge), and null (no segment override). Verified the integer-FK test fails on main with the reported exception, then passes after the fix.

    • Full unit test suite passes locally with no regressions.

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner May 8, 2026 12:43
@Zaimwa9 Zaimwa9 requested review from emyller and removed request for a team May 8, 2026 12:43
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.

Fine, bar 1 comment.

@Zaimwa9 Zaimwa9 merged commit e567698 into main May 8, 2026
13 checks passed
@Zaimwa9 Zaimwa9 deleted the fix/feature-segment-deserialization branch May 8, 2026 13:04
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.

Java client MismatchedInputException on FeatureSegmentModel

3 participants