Customers using a JSON flag often prefer the evaluation result return a custom object instead of an LDValue. This commit supports that by introducing a new LDValueDecoder (copied and lightly modified from the Swift Core Libs JSONDecoder implementation).
This decoder allows decoding into arbitrary types directly from an LDValue, without paying the penalty for an intermediate JSON encoding step (i.e. LDValue -> JSON str -> Custom Type).
Customers using a JSON flag often prefer the evaluation result return a custom object instead of an LDValue. This commit supports that by introducing a new
LDValueDecoder
(copied and lightly modified from the Swift Core LibsJSONDecoder
implementation).This decoder allows decoding into arbitrary types directly from an LDValue, without paying the penalty for an intermediate JSON encoding step (i.e. LDValue -> JSON str -> Custom Type).