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

Defines targeting logic for flagd; a extension of JSONLogic, including purpose-built feature-flagging operations. Note that this schema applies to top-level objects; no additional properties are supported, including "$schema", which means built-in JSON-schema support is not possible in editors. Please use flags.json (which imports this schema) for a rich editor experience.

Any of

1. object object
2. anyRule varRule | missingRule | missingSomeRule | binaryRule | binaryOrTernaryRule | associativeRule | unaryRule | variadicRule | reduceRule | stringCompareRule | ruleSemVer | fractionalRule

Definitions

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
substr args[]
minItems=2maxItems=3
< args[]
minItems=2maxItems=3
<= args[]
minItems=2maxItems=3
binaryOp args[]
binaryRule object

Any primitive JSONLogic operation with 2 operands.

if args[]
minItems=1
== 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[] | args
unaryRule object

Any primitive JSONLogic operation with 1 operands.

! args[] | args
!! args[] | args
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.

fractionalOp fractionalWeightArg[]
fractionalShorthandOp fractionalWeightArg[]
fractionalRule object

Deterministic, pseudorandom fractional distribution.

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