Skip to content

Commit

Permalink
chore: Clarify resolution detail reason. (#239)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lamb <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
  • Loading branch information
kinyoklion and beeme1mr authored Feb 5, 2024
1 parent a0c79d7 commit 738bb41
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Other(String)
}

let myReason = Reason::Other("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.
Expand Down

0 comments on commit 738bb41

Please sign in to comment.