We highly recommend checking out the official learning Jsonnet tutorial.
Formatting Jsonnet Code
Format Jsonnet code snippets using:
Linting Jsonnet Code
Lint Jsonnet code snippets using:
The command will exit with an exit code of
1 and print all found lint errors
to stderr if the code snippet has lint issues.
Testing Jsonnet Code
This is an anticipated future feature. For progress check out kratos#391.
Tips & Tricks
The purpose of this section is to provide you with examples for common use cases.
When you're unsure that a field will be set in the
claims variable use the
following to make the trait field also optional:
Set defaults for the
You can raise errors in the Jsonnet code. Keep in mind that these will be shown as system errors, not validation errors, and that the user will end up at the Error UI!