Skip to content

Commit 8f0d26a

Browse files
committed
docs: table for RuleAction, remove mentions
1 parent 4623e30 commit 8f0d26a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Diff for: docs/utilities/feature_flags.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ You can use `get_enabled_features` method for scenarios where you need a list of
366366
"when_match": true,
367367
"conditions": [
368368
{
369-
"action": "IN",
369+
"action": "KEY_IN_VALUE",
370370
"key": "CloudFront-Viewer-Country",
371371
"value": ["NL", "IE", "UK", "PL", "PT"]
372372
}
@@ -450,9 +450,20 @@ The `conditions` block is a list of conditions that contain `action`, `key`, and
450450
}
451451
```
452452

453-
The `action` configuration can have 5 different values: `EQUALS`, `STARTSWITH`, `ENDSWITH`, `KEY_IN_VALUE`, `KEY_NOT_IN_VALUE`, `VALUE_IN_KEY`, and `VALUE_NOT_IN_KEY`. Note that `IN` and `NOT_IN` are also defined and are synonymous with `KEY_IN_VALUE` and `KEY_NOT_IN_VALUE` respectively.
453+
The `action` configuration can have the following values, where the expressions **`a`** is the `key` and **`b`** is the `value` above:
454454

455-
The `key` and `value` will be compared to the input from the context parameter.
455+
Action | Equivalent expression
456+
------------------------------------------------- | ---------------------------------------------------------------------------------
457+
**EQUALS** | `lambda a, b: a == b`
458+
**STARTSWITH** | `lambda a, b: a.startswith(b)`
459+
**ENDSWITH** | `lambda a, b: a.endswith(b)`
460+
**KEY_IN_VALUE** | `lambda a, b: a in b`
461+
**KEY_NOT_IN_VALUE** | `lambda a, b: a not in b`
462+
**VALUE_IN_KEY** | `lambda a, b: b in a`
463+
**VALUE_NOT_IN_KEY** | `lambda a, b: b not in a`
464+
465+
466+
!!! info "The `**key**` and `**value**` will be compared to the input from the `**context**` parameter."
456467

457468
**For multiple conditions**, we will evaluate the list of conditions as a logical `AND`, so all conditions needs to match to return `when_match` value.
458469

0 commit comments

Comments
 (0)