Skip to content

Commit

Permalink
chore: Clarify resolution detail reason.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lamb <[email protected]>
  • Loading branch information
kinyoklion committed Jan 29, 2024
1 parent afe1c7e commit fdf66d7
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,
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.
Expand Down

0 comments on commit fdf66d7

Please sign in to comment.