Type object
Schema URL https://catalog.lintel.tools/schemas/schemastore/flagd-flag-configuration/_shared/0.2.0--targeting.json
Parent schema flagd-flag-configuration
Type: object

Defines targeting logic for flagd; a extension of JSONLogic, including purpose-built feature-flagging operations.

Definitions

targeting object | anyRule

An expression returning a value which is coerced to a string to be used as a targeting key, or null (to fall back to defaultVariant). If targeting returns a value which is not a variant key, it's considered an error.

primitive null | boolean | number | string | array
varRule object

Retrieve data from the provided data object.

var string | null | boolean | string | number[]
missingRule object

Takes an array of data keys to search for (same format as var). Returns an array of any keys that are missing from the data object, or an empty array.

missing string[]
missingSomeRule object

Takes a minimum number of data keys that are required, and an array of keys to search for (same format as var or missing). Returns an empty array if the minimum is met, or an array of the missing keys otherwise.

missing_some array
minItems=2maxItems=2
binaryOrTernaryOp args[]
binaryOrTernaryRule object
if args[]
minItems=2maxItems=3
substr args[]
minItems=2maxItems=3
< args[]
minItems=2maxItems=3
<= args[]
minItems=2maxItems=3
binaryOp args[]
binaryRule object

Any primitive JSONLogic operation with 2 operands.

== args[]
minItems=2maxItems=2
=== args[]
minItems=2maxItems=2
!= args[]
minItems=2maxItems=2
!== args[]
minItems=2maxItems=2
> args[]
minItems=2maxItems=2
>= args[]
minItems=2maxItems=2
% args[]
minItems=2maxItems=2
/ args[]
minItems=2maxItems=2
map args[]
minItems=2maxItems=2
filter args[]
minItems=2maxItems=2
all args[]
minItems=2maxItems=2
none args[]
minItems=2maxItems=2
some args[]
minItems=2maxItems=2
in args[]
minItems=2maxItems=2
reduceRule object
reduce args[]

Combine all the elements in an array into a single value, like adding up a list of numbers. Note, that inside the logic being used to reduce, var operations only have access to an object with a "current" and a "accumulator".

minItems=3maxItems=3
associativeOp args[]
associativeRule object

Operation applicable to 2 or more parameters.

* args[]
minItems=2
unaryOp args[]
unaryRule object

Any primitive JSONLogic operation with 1 operands.

! args[]
minItems=1maxItems=1
!! args[]
minItems=1maxItems=1
variadicOp args[]
variadicRule object
or args[]
minItems=1
and args[]
minItems=1
+ args[]
minItems=1
- args[]
minItems=1
max args[]
minItems=1
min args[]
minItems=1
merge args[]
minItems=1
cat args[]
minItems=1
stringCompareArg string | anyRule
stringCompareArgs stringCompareArg[]
stringCompareRule object
starts_with stringCompareArg[]
minItems=2maxItems=2
ends_with stringCompareArg[]
minItems=2maxItems=2
semVerString string

A string representing a valid semantic version expression as per https://semver.org/.

ruleSemVer object
sem_ver array

Attribute matches a semantic version condition. Accepts "npm-style" range specifiers: "=", "!=", ">", "<", ">=", "<=", "~" (match minor version), "^" (match major version).

minItems=3maxItems=3
fractionalWeightArg array

Distribution for all possible variants, with their associated weighting out of 100.

fractionalOp fractionalWeightArg[]
fractionalShorthandOp fractionalWeightArg[]
fractionalRule object

Deterministic, pseudorandom fractional distribution.

reference object
$ref string

A reference to another entity, used for $evaluators (shared rules).

args reference | anyRule | primitive
anyRule varRule | missingRule | missingSomeRule | binaryRule | binaryOrTernaryRule | associativeRule | unaryRule | variadicRule | reduceRule | stringCompareRule | ruleSemVer | fractionalRule