From fdf66d77b127545cc3c1f2ab3593a9fb02d3118e Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:52:18 -0800 Subject: [PATCH 1/3] chore: Clarify resolution detail reason. Signed-off-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> --- specification/types.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/specification/types.md b/specification/types.md index 054f8d30..76a5abe1 100644 --- a/specification/types.md +++ b/specification/types.md @@ -72,6 +72,28 @@ A set of pre-defined reasons is enumerated below: | STALE | The resolved value is non-authoritative or possibly out of date | | ERROR | The resolved value was the result of an error. | +> [!NOTE] +> The `reason` should not be limited to the reasons enumerated above. It can be any of the pre-defined reasons, or +> any string value. Some type systems have features which can increase the ergonomics of `reason`, for instance a union +of pre-defined types with a string, or a rust-style enumeration which allows for enumerated values to have associated +content. + +```rust +enum Reason { + Static, + Default, + TargetingMatch, + Split, + Cached, + Unknown, + Stale, + Error, + Custom(String) +} + +let myReason = Reason::Custom("my-reason".to_string()); +``` + > [!NOTE] > The `resolution details` structure is not exposed to the Application Author. > It defines the data which Provider Authors must return when resolving the value of flags. From 7c547f68a33e6c31099a498ae0dda19537bfac05 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:00:12 -0800 Subject: [PATCH 2/3] Change to other to match Rust SDK. Signed-off-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> --- specification/types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/types.md b/specification/types.md index 76a5abe1..d36ffa34 100644 --- a/specification/types.md +++ b/specification/types.md @@ -88,10 +88,10 @@ enum Reason { Unknown, Stale, Error, - Custom(String) + Other(String) } -let myReason = Reason::Custom("my-reason".to_string()); +let myReason = Reason::Other("my-reason".to_string()); ``` > [!NOTE] From 5d2557025f8f469b41b06dc8811ec2828ec61bc9 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Tue, 30 Jan 2024 09:43:04 -0800 Subject: [PATCH 3/3] Update specification/types.md Co-authored-by: Michael Beemer Signed-off-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> --- specification/types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/types.md b/specification/types.md index d36ffa34..e69f283d 100644 --- a/specification/types.md +++ b/specification/types.md @@ -75,8 +75,8 @@ A set of pre-defined reasons is enumerated below: > [!NOTE] > The `reason` should not be limited to the reasons enumerated above. It can be any of the pre-defined reasons, or > any string value. Some type systems have features which can increase the ergonomics of `reason`, for instance a union -of pre-defined types with a string, or a rust-style enumeration which allows for enumerated values to have associated -content. +> of pre-defined types with a string, or a rust-style enumeration which allows for enumerated values to have associated +> content. ```rust enum Reason {