Skip to content

Commit 33adc35

Browse files
committed
Revert "chore: removing unused code"
1 parent c655827 commit 33adc35

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pkg/js/validator/validate-store.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,36 @@ const validateStore: SchemaValidateFunction = function (
725725
return validateTestTypes(store, this.jsonModel, ctx.instancePath);
726726
};
727727

728+
// YAML validation using ajv
729+
export function YamlTuplesValidator(): ValidateFunction {
730+
return new Ajv({
731+
allErrors: true,
732+
verbose: true,
733+
passContext: true,
734+
$data: true,
735+
})
736+
.addFormat("user", {
737+
validate: Validate.user,
738+
})
739+
.addFormat("relation", {
740+
validate: Validate.relation,
741+
})
742+
.addFormat("object", {
743+
validate: Validate.object,
744+
})
745+
.addFormat("condition", {
746+
validate: Validate.relationshipCondition,
747+
})
748+
.addKeyword({
749+
keyword: "valid_tuple",
750+
type: "object",
751+
schema: false,
752+
errors: true,
753+
validate: validateTuple,
754+
})
755+
.compile(OPENFGA_TUPLES_SCHEMA);
756+
}
757+
728758
// YAML tuple validation
729759
const OPENFGA_TUPLES_SCHEMA: Schema = {
730760
type: "array",

0 commit comments

Comments
 (0)