Need comprehensive schema documentation for Flipt Flags in JSON and YAML #4758
Replies: 2 comments 2 replies
-
Here’s a comprehensive schema reference for Flipt Flags, including required/optional fields, data types, constraints, and canonical examples in both JSON and YAML. This reflects the current schema as implemented in recent Flipt releases (source, source, source). Flipt Flag Schema (core fields)
Variant
Rule
Distribution
Rollout
SegmentRule
ThresholdRule
Canonical JSON Example{
"version": "1.3",
"flags": [
{
"key": "flag1",
"name": "flag1",
"type": "VARIANT_FLAG_TYPE",
"description": "description",
"enabled": true,
"variants": [
{
"key": "variant1",
"name": "variant1",
"description": "variant description",
"attachment": {
"pi": 3.141,
"happy": true,
"name": "Niels",
"answer": { "everything": 42 },
"list": [1, 0, 2],
"object": { "currency": "USD", "value": 42.99 }
}
}
],
"rules": [
{
"segment": "segment1",
"rank": 1,
"distributions": [{ "variant": "variant1", "rollout": 100 }]
}
],
"metadata": {
"label": "variant",
"area": true
}
},
{
"key": "flag2",
"name": "flag2",
"type": "BOOLEAN_FLAG_TYPE",
"description": "a boolean flag",
"enabled": false,
"rollouts": [
{
"description": "enabled for internal users",
"segment": { "key": "internal_users", "value": true }
},
{
"description": "enabled for 50%",
"threshold": { "percentage": 50, "value": true }
}
],
"metadata": {
"label": "bool",
"area": 12
}
}
],
"segments": [
{
"key": "segment1",
"name": "segment1",
"match_type": "ANY_MATCH_TYPE",
"description": "description",
"constraints": [
{
"type": "STRING_COMPARISON_TYPE",
"property": "fizz",
"operator": "neq",
"value": "buzz"
}
]
}
]
} (source) Canonical YAML Exampleversion: "1.3"
flags:
- key: flag1
name: flag1
type: "VARIANT_FLAG_TYPE"
description: description
enabled: true
variants:
- key: variant1
name: variant1
description: variant description
attachment:
pi: 3.141
happy: true
name: Niels
answer:
everything: 42
list:
- 1
- 0
- 2
object:
currency: USD
value: 42.99
rules:
- segment: segment1
rank: 1
distributions:
- variant: variant1
rollout: 100
metadata:
label: variant
area: true
- key: flag2
name: flag2
type: "BOOLEAN_FLAG_TYPE"
description: a boolean flag
enabled: false
rollouts:
- description: enabled for internal users
segment:
key: internal_users
value: true
- description: enabled for 50%
threshold:
percentage: 50
value: true
metadata:
label: bool
area: 12
segments:
- key: segment1
name: segment1
match_type: "ANY_MATCH_TYPE"
description: description
constraints:
- type: STRING_COMPARISON_TYPE
property: fizz
operator: neq
value: buzz (source) Constraints & Notes
For more details, see the Go struct definitions and test data examples. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Hey @rohitnarayan , Yeah... There are some missing dots in the documentation. There is the schema for Flipt Flags. We provide the cue and json ones. The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Currently, there is no single reference that outlines the complete schema for Flipt Flags. Having a clear, detailed schema in both JSON and YAML formats would help developers understand how to define and manage flags consistently.
Requirements / Goals:
Benefits:
Additional context:
If possible, include references to existing flag documentation, but consolidate the full schema in one easily accessible place.
Beta Was this translation helpful? Give feedback.
All reactions