validate
Validate Flipt flag state (.yaml, .yml) files
Options
Behavior
This command validates Flipt’s declarative feature configuration files.
It looks for features flag definitions in the same way as Flipt’s declarative backends. Checkout the documentation on locating flag state to learn more about this process.
Extra Schema
The flag --extra-schema
(short form -e
) can be used to pass additional constraints via a CUE schema file.
This file will be unified with the base schema used within flipt validate
to ensure the format of Flipt files.
You can find the base schema here.
As an example, take the following flipt features.yaml
file:
Running validate will succeed when provided with a path to this file.
By default, the flag description
field is not required. However, imagine that you want to ensure this field is always provided with a non-empty string. You can do this via the --extra-schema
flag and a CUE definition.
In this instance we’re going to create a CUE file named extended.cue
.
Within this file we will add a constraint to the #Flag
CUE definition, which ensures our desired behavior.
This definition ensures that description is both supplied and that the value matches the regular expression. The regular expression in this example ensures a string with a length of at least 1 character.
Now when invoking the validate sub-command, we pass the path to this extra CUE definition:
Here we see that our additional constraint on description is being validated and described in the output.
More Info
See the flag state section of the documentation for more information.