Repository navigation
Tolerate unknown fields in OpenFlagr evaluation responses - #9
Merged
Merged
Conversation
OpenFlagr 1.2.3 added new fields (flagTags, recordSource) to the POST /api/v1/evaluation response. DefaultOpenFlagrApiClient used a default ObjectMapper with FAIL_ON_UNKNOWN_PROPERTIES enabled, so deserialization threw on the new fields and every flag evaluation silently fell back to its default value (off / empty). Disable FAIL_ON_UNKNOWN_PROPERTIES on the client's ObjectMapper so server-side additive changes no longer break evaluation, and add a MockWebServer regression test covering a 1.2.3-style response. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fukuanru
force-pushed
the
bugfix/tolerate-unknown-response-fields
branch
from
August 20, 2026 06:04
84d2d9a to
2705da4
Compare
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.
Problem
OpenFlagr 1.2.3 added new fields (
flagTags,recordSource) to thePOST /api/v1/evaluationresponse.DefaultOpenFlagrApiClientdeserializes the response with a default-configuredObjectMapper, whoseFAIL_ON_UNKNOWN_PROPERTIESis enabled, so Jackson throws on the new fields. The exception is wrapped intoOpenFlagrException, whichDefaultOpenFlagrcatches and turns intofalse/Optional.empty()— meaning that after a server-side OpenFlagr upgrade, every feature flag silently falls back to its default value while the service keeps running with only an error log (failed to execute post evaluation).We hit this in production-like environments: all flags evaluated as off/empty for a full day until the server was rolled back.
Fix
Disable
FAIL_ON_UNKNOWN_PROPERTIESon the client'sObjectMapper, so additive response changes from newer OpenFlagr servers no longer break deserialization. This is the standard posture for an API client per the robustness principle.Test
Added a
MockWebServerregression test that replays an OpenFlagr 1.2.3-style evaluation response containingflagTags/recordSourceand unknown nested fields:failed to execute post evaluation,isFeatureFlagOnreturnsfalse).postEvaluationparses the response andisFeatureFlagOnreturnstrue../gradlew buildpasses for the whole project.🤖 Generated with Claude Code