feat: add v4 evaluation response types to provider library - #50
Closed
lourens-octopus wants to merge 1 commit into
Closed
feat: add v4 evaluation response types to provider library#50lourens-octopus wants to merge 1 commit into
lourens-octopus wants to merge 1 commit into
Conversation
lourens-octopus
force-pushed
the
lourens/bmbb-674
branch
2 times, most recently
from
August 9, 2026 21:51
42d4ba6 to
74cc872
Compare
Adds the OctoToggle v4 evaluation-response contract as package-private types in a v4 sub-package, without hooking them up to anything. The existing v3 evaluation path is untouched. Unrecognised (or absent) client-side condition discriminators deserialize to UnknownCondition rather than failing the whole response, so a condition type introduced by a newer server degrades safely on an older client. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lourens-octopus
force-pushed
the
lourens/bmbb-674
branch
from
August 9, 2026 22:20
74cc872 to
3be7803
Compare
Contributor
Author
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.
Resolves BMBB-747. Java counterpart of openfeature-provider-dotnet#92, which resolved the .NET equivalent, BMBB-674.
What
Adds the OctoToggle v4 evaluation-response contract as types only — nothing is hooked up, and the v3 path is untouched. The provider only ever deserializes this response (
GET api/toggles/evaluations/v4→ array ofServerSideEvaluation); OctoToggle resolves the server-side conditions itself and sends only the client-side ones, keyed by a camelCasetypediscriminator.New in
src/main/java/com/octopus/openfeature/provider/v4/:ServerSideEvaluation(server-resolvedvalue/reason, or deferredevaluationKey/rules),ClientSideRule, the polymorphicClientSideConditionand its three variants,UnknownCondition, andConditionTypeNames.Decisions
Types are package-private in a
v4sub-package — Java's nearest equivalent tointernal. The public API is unchanged: still justOctopusProvider,OctopusConfigurationandProductMetadata.Worth knowing for the follow-up, since Java package access isn't hierarchical:
…providercannot see these types. This assumes the v4 evaluation logic will live in thev4package too, exposing a single public entry point when it lands. Nothing needs one yet, so this PR adds none.Unknown conditions degrade gracefully. An unrecognised or absent discriminator deserializes to
UnknownConditionrather than failing the whole response, so a condition type introduced by a newer server is treated as "not met" by an older client. Jackson's@JsonTypeInfo(defaultImpl = …)covers both cases, so .NET's custom converter has no equivalent here.Client-side condition evaluation is left unimplemented, per the ticket — it lands in the follow-up. The types are named for what they become there, so that PR is not a rename of everything introduced here.
TestObjectMapperis a test-only shim exposing the package-privateOctopusObjectMapper, so the v4 tests exercise the production mapper rather than a copy that could drift from it.Tests
ServerSideEvaluationDeserializationTests— 15 tests covering each condition type, mixed arrays, both response shapes, the unknown- and missing-discriminator fallbacks, a missing required property, extraneous properties, and list immutability. Two of them pin down casing: the discriminator property name is case-insensitive, its value is matched exactly.230 tests pass, 0 failures. Public API surface confirmed unchanged via
javap.🤖 Generated with Claude Code