[System]
You are a helpful assistant that answers strictly in JSON. Here's the JSON schema you must adhere to:
<schema>
{"$schema":"https://json-schema.org/draft/2020-12/schema","$defs":{"DTO":{"properties":{"trackEvents":{"type":"boolean"},"disable":{"type":"boolean"},"version":{"type":"string"},"converter":{"type":"string"},"variations":{"additionalProperties":true,"type":"object","title":"variations","description":"All the variations available for this flag. You need at least 2 variations and it is a key value pair. All the variations should have the same type."},"targeting":{"items":{"$ref":"#/$defs/Rule"},"type":"array","title":"targeting","description":"List of rule to target a subset of the users based on the evaluation context."},"bucketingKey":{"type":"string"},"defaultRule":{"$ref":"#/$defs/Rule","title":"defaultRule","description":"How do we evaluate the flag if the user is not part of any of the targeting rule."},"scheduledRollout":{"items":{"$ref":"#/$defs/ScheduledStep"},"type":"array","title":"scheduledRollout","description":"Configure an update on some fields of your flag over time."},"experimentation":{"$ref":"#/$defs/ExperimentationDto","title":"experimentation","description":"Configure an experimentation. It will allow you to configure a start date and an end date for your flag."},"metadata":{"type":"object","title":"metadata","description":"A field containing information about your flag such as an issue tracker link a description etc..."}},"additionalProperties":false,"type":"object","required":["variations","defaultRule"]},"ExperimentationDto":{"properties":{"start":{"type":"string","format":"date-time","title":"start","description":"Time of the start of the experimentation."},"end":{"type":"string","format":"date-time","title":"start","description":"Time of the end of the experimentation."}},"additionalProperties":false,"type":"object","required":["start","end"]},"ExperimentationRollout":{"properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"additionalProperties":false,"type":"object"},"ProgressiveRollout":{"properties":{"initial":{"$ref":"#/$defs/ProgressiveRolloutStep","title":"initial","description":"A description of the initial state of the rollout."},"end":{"$ref":"#/$defs/ProgressiveRolloutStep","title":"initial","description":"A description of the end state of the rollout."}},"additionalProperties":false,"type":"object"},"ProgressiveRolloutStep":{"properties":{"variation":{"type":"string","title":"variation","description":"Name of the variation to apply."},"percentage":{"type":"number","title":"percentage","description":"The percentage (initial or end) for the progressive rollout."},"date":{"type":"string","format":"date-time","title":"date","description":"Date is the time it starts or ends."}},"additionalProperties":false,"type":"object","required":["variation","percentage","date"]},"Rule":{"properties":{"name":{"type":"string","title":"name","description":"Name is the name of the rule. This field is mandatory if you want to update the rule during scheduled rollout."},"query":{"type":"string","title":"query","description":"The query that allow to check in the evaluation context match. Note: in the defaultRule field query is ignored."},"variation":{"type":"string","title":"variation","description":"The variation name to use if the rule apply for the user. In case we have a percentage field in the config this field is ignored"},"percentage":{"additionalProperties":{"type":"number"},"type":"object","title":"percentage","description":"Represents the percentage we should give to each variation."},"progressiveRollout":{"$ref":"#/$defs/ProgressiveRollout","title":"progressiveRollout","description":"Configure a progressive rollout deployment of your flag."},"disable":{"type":"boolean","title":"disable","description":"Indicates that this rule is disabled."}},"additionalProperties":false,"type":"object"},"ScheduledStep":{"properties":{"variations":{"additionalProperties":true,"type":"object"},"targeting":{"items":{"$ref":"#/$defs/Rule"},"type":"array"},"bucketingKey":{"type":"string"},"defaultRule":{"$ref":"#/$defs/Rule"},"experimentation":{"$ref":"#/$defs/ExperimentationRollout"},"scheduledRollout":{"items":{"$ref":"#/$defs/ScheduledStep"},"type":"array"},"trackEvents":{"type":"boolean"},"disable":{"type":"boolean"},"version":{"type":"string"},"metadata":{"type":"object"},"date":{"type":"string","format":"date-time"}},"additionalProperties":false,"type":"object"}},"additionalProperties":{"$ref":"#/$defs/DTO"},"type":"object"}
</schema>

[User] Provide a JSON object that satisfies the schema "flag-schema". Here are the required top‑level fields: none (all optional). Return only the valid JSON object.

variations

All the variations available for this flag. You need at least 2 variations and it is a key value pair. All the variations should have the same type.

targeting

List of rule to target a subset of the users based on the evaluation context.

defaultRule

How do we evaluate the flag if the user is not part of any of the targeting rule.

scheduledRollout

Configure an update on some fields of your flag over time.

experimentation

Configure an experimentation. It will allow you to configure a start date and an end date for your flag.

metadata

A field containing information about your flag such as an issue tracker link a description etc...

start

Time of the start of the experimentation.

start

Time of the end of the experimentation.

initial

A description of the initial state of the rollout.

initial

A description of the end state of the rollout.

variation

Name of the variation to apply.

percentage

The percentage (initial or end) for the progressive rollout.

date

Date is the time it starts or ends.

name

Name is the name of the rule. This field is mandatory if you want to update the rule during scheduled rollout.

query

The query that allow to check in the evaluation context match. Note: in the defaultRule field query is ignored.

variation

The variation name to use if the rule apply for the user. In case we have a percentage field in the config this field is ignored

percentage

Represents the percentage we should give to each variation.

progressiveRollout

Configure a progressive rollout deployment of your flag.

disable

Indicates that this rule is disabled.

Provide a JSON object that satisfies the schema "flag-schema". Here are the required top‑level fields: none (all optional). Return only the valid JSON object.


[System]
You are a helpful assistant that answers strictly in JSON. Here's the JSON schema you must adhere to:
<schema>
{"$id":"https://flagd.dev/schema/v0/flags.json","$schema":"http://json-schema.org/draft-07/schema#","title":"flagd Flag Configuration","description":"Defines flags for use in flagd, including typed variants and rules.","type":"object","properties":{"flags":{"title":"Flags","description":"Top-level flags object. All flags are defined here.","type":"object","$comment":"flag objects are one of the 4 flag types defined in definitions","additionalProperties":false,"patternProperties":{"^.{1,}$":{"oneOf":[{"title":"Boolean flag","description":"A flag having boolean values.","$ref":"#/definitions/booleanFlag"},{"title":"String flag","description":"A flag having string values.","$ref":"#/definitions/stringFlag"},{"title":"Numeric flag","description":"A flag having numeric values.","$ref":"#/definitions/numberFlag"},{"title":"Object flag","description":"A flag having arbitrary object values.","$ref":"#/definitions/objectFlag"}]}}},"$evaluators":{"title":"Evaluators","description":"Reusable targeting rules that can be referenced with \"$ref\": \"myRule\" in multiple flags.","type":"object","additionalProperties":false,"patternProperties":{"^.{1,}$":{"$comment":"this relative ref means that targeting.json MUST be in the same dir, or available on the same HTTP path","$ref":"./targeting.json"}}},"metadata":{"title":"Flag Set Metadata","description":"Metadata about the flag set, with keys of type string, and values of type boolean, string, or number.","properties":{"flagSetId":{"description":"The unique identifier for the flag set.","type":"string"},"version":{"description":"The version of the flag set.","type":"string"}},"$ref":"#/definitions/metadata"}},"definitions":{"flag":{"$comment":"base flag object; no title/description here, allows for better UX, keep it in the overrides","type":"object","properties":{"state":{"title":"Flag State","description":"Indicates whether the flag is functional. Disabled flags are treated as if they don't exist.","type":"string","enum":["ENABLED","DISABLED"]},"defaultVariant":{"title":"Default Variant","description":"The variant to serve if no dynamic targeting applies (including if the targeting returns null).","type":"string"},"targeting":{"$ref":"./targeting.json"},"metadata":{"title":"Flag Metadata","description":"Metadata about an individual feature flag, with keys of type string, and values of type boolean, string, or number.","$ref":"#/definitions/metadata"}},"required":["state","defaultVariant"]},"booleanVariants":{"type":"object","properties":{"variants":{"type":"object","additionalProperties":false,"patternProperties":{"^.{1,}$":{"type":"boolean"}},"default":{"true":true,"false":false}}}},"stringVariants":{"type":"object","properties":{"variants":{"type":"object","additionalProperties":false,"patternProperties":{"^.{1,}$":{"type":"string"}}}}},"numberVariants":{"type":"object","properties":{"variants":{"type":"object","additionalProperties":false,"patternProperties":{"^.{1,}$":{"type":"number"}}}}},"objectVariants":{"type":"object","properties":{"variants":{"type":"object","additionalProperties":false,"patternProperties":{"^.{1,}$":{"type":"object"}}}}},"booleanFlag":{"$comment":"merge the variants with the base flag to build our typed flags","allOf":[{"$ref":"#/definitions/flag"},{"$ref":"#/definitions/booleanVariants"}]},"stringFlag":{"allOf":[{"$ref":"#/definitions/flag"},{"$ref":"#/definitions/stringVariants"}]},"numberFlag":{"allOf":[{"$ref":"#/definitions/flag"},{"$ref":"#/definitions/numberVariants"}]},"objectFlag":{"allOf":[{"$ref":"#/definitions/flag"},{"$ref":"#/definitions/objectVariants"}]},"metadata":{"type":"object","additionalProperties":{"description":"Any additional key/value pair with value of type boolean, string, or number.","type":["string","number","boolean"]},"required":[]}}}
</schema>

[User] Provide a JSON object that satisfies the schema "flagd Flag Configuration". Here are the required top‑level fields: none (all optional). Return only the valid JSON object.

flagd Flag Configuration

Defines flags for use in flagd, including typed variants and rules.

Flags

Top-level flags object. All flags are defined here.

flag objects are one of the 4 flag types defined in definitions

Boolean flag

A flag having boolean values.

String flag

A flag having string values.

Numeric flag

A flag having numeric values.

Object flag

A flag having arbitrary object values.

Evaluators

Reusable targeting rules that can be referenced with "$ref": "myRule" in multiple flags.

this relative ref means that targeting.json MUST be in the same dir, or available on the same HTTP path

Flag Set Metadata

Metadata about the flag set, with keys of type string, and values of type boolean, string, or number.

The unique identifier for the flag set.

The version of the flag set.

base flag object; no title/description here, allows for better UX, keep it in the overrides

Flag State

Indicates whether the flag is functional. Disabled flags are treated as if they don't exist.

Default Variant

The variant to serve if no dynamic targeting applies (including if the targeting returns null).

Flag Metadata

Metadata about an individual feature flag, with keys of type string, and values of type boolean, string, or number.

merge the variants with the base flag to build our typed flags

Any additional key/value pair with value of type boolean, string, or number.

Provide a JSON object that satisfies the schema "flagd Flag Configuration". Here are the required top‑level fields: none (all optional). Return only the valid JSON object.