harness-community / openfeature-java-provider

Apache License 2.0
0 stars 1 forks source link

OF Provider 2.3 #12

Open scalabl3 opened 1 year ago

scalabl3 commented 1 year ago

https://docs.openfeature.dev/docs/specification/sections/providers#flag-value-resolution

Condition 2.3 The implementing language type system differentiates between strings, numbers, booleans and structures.

Conditional Requirement 2.3.1 The feature provider interface MUST define methods for typed flag resolution, including boolean, numeric, string, and structure.

ResolutionDetails resolveBooleanValue(string flagKey, boolean defaultValue, context: EvaluationContext);

// example string flag value resolution
ResolutionDetails resolveStringValue(string flagKey, string defaultValue, context: EvaluationContext);

// example number flag value resolution
ResolutionDetails resolveNumberValue(string flagKey, number defaultValue, context: EvaluationContext);

// example structure flag value resolution
ResolutionDetails resolveStructureValue(string flagKey, JsonObject defaultValue, context: EvaluationContext);

Reference Provider (JAVA): https://github.com/splitio/split-openfeature-provider-java/blob/main/src/main/java/io/split/openfeature/SplitProvider.java

Conventions Checklist: https://docs.openfeature.dev/docs/reference/concepts/provider/#checklist