fix: correct format on resolve tester base64 encoded json #223
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.
Previously the resulting json contained the context value type which meant that while the base64 decoding worked in the Confidence app the resolve was not working properly.
JSON Format Examples - Before vs After
Before the Fix (Incorrect - Type Wrappers)
The Confidence SDK was incorrectly serializing context with type wrapper objects:
{ "flag": "flags/test-flag", "context": { "visitor_id": {"string": "bcd97b13-ddad-4ee8-9331-aeac06370bd9"}, "targeting_key": {"string": "test-user-123"}, "user": { "map": { "country": {"string": "SE"}, "age": {"integer": 25}, "product": {"string": "premium"}, "fraud-score": {"double": 0.7} } } }, "clientKey": "test-client-secret" }Issues:
{"string": "value"}, {"integer": 25}, {"double": 0.7}{"map": {...}}After the Fix (Correct - Clean JSON)
The Confidence SDK now produces clean JSON matching the OpenFeature provider:
{ "flag": "flags/test-flag", "context": { "visitor_id": "bcd97b13-ddad-4ee8-9331-aeac06370bd9", "targeting_key": "test-user-123", "user": { "country": "SE", "age": 25, "product": "premium", "fraud-score": 0.7 } }, "clientKey": "test-client-secret" }