You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support JSON array/list defaults in structured-value evaluation #22
Please support JSON array/list defaults and results in the Elixir SDK's structured-value evaluation API.
Current behavior
OpenFeature.Client.get_map_value/4 and get_map_details/4 require is_map(default). Passing a list such as [] raises FunctionClauseError before the provider is called:
A provider can already return a list when the caller passes a map default, because the client does not restrict the returned value. However, callers cannot provide a fallback with the same shape as an array payload.
We verified an array payload can be returned through the real client using %{} as the default. We would like users to pass [] or a populated list instead, so a failed evaluation can return an array fallback rather than a map.
Python SDK precedent
The Python SDK already accepts Sequence[FlagValueType] | Mapping[str, FlagValueType] defaults and results for get_object_value and get_object_details, including their async variants:
We also verified that empty and nonempty list defaults work through the Python client in openfeature-sdk 0.10.0.
Suggested behavior
Please consider either widening the existing map getters or introducing an object/structured-value API that accepts both maps and JSON-compatible lists, while preserving existing map calls. The public types, provider callback contract, and documentation should reflect whichever API is chosen.
Suggested test coverage:
Empty and populated list defaults reach the provider.
List results, including nested JSON arrays/objects, are returned unchanged.
Failed evaluations return the supplied list default in both value and details getters.
Existing map defaults and results keep working.
This request is separate from error-hook behavior and does not require any PostHog-specific handling.
Activity