Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clarify resolution detail reason. #239

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
kinyoklion marked this conversation as resolved.
Show resolved Hide resolved
enum Reason {
Static,
Default,
TargetingMatch,
Split,
Cached,
Unknown,
Stale,
Error,
Other(String)
kinyoklion marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading