Skip to content

Commit f4a8c34

Browse files
committed
Add operator keyword to schemas
1 parent be8a651 commit f4a8c34

13 files changed

+27
-17
lines changed

lib/schemas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const ajv = new Ajv({
1414
strict: true
1515
})
1616
addFormats(ajv)
17-
17+
ajv.addKeyword('operator')
1818

1919
// Delegate property access to the schema definition
2020
const DelegateToDefinition = {

schemas/Add.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/Add.schema.json",
44
"title": "Add",
55
"description": "Add two values",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "+",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/Divide.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/Divide.schema.json",
44
"title": "Divide",
55
"description": "Divide two values",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "/",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/Duration.schema.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
"items": [
88
{ "$ref": "schema.json#/definitions/number" },
99
{
10-
"title": "Unit",
1110
"anyOf": [
1211
{
12+
"title": "Unit",
1313
"type": "string",
14-
"enum": ["seconds", "minutes", "hours", "days", "weeks", "months", "years"],
15-
"default": "seconds"
14+
"enum": ["seconds", "minutes", "hours", "days", "weeks", "months", "years"]
1615
},
1716
{ "$ref": "schema.json#/definitions/function" }
1817
]

schemas/Equal.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/Equal.schema.json",
44
"title": "Equal",
55
"description": "Compare two values for equality",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "==",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/GreaterThan.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/GreaterThan.schema.json",
44
"title": "GreaterThan",
55
"description": "Compare if the first argument is > the second argument.",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": ">",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/GreaterThanOrEqualTo.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/GreaterThanOrEqualTo.schema.json",
44
"title": "GreaterThanOrEqualTo",
55
"description": "Compare if the first argument is >= the second argument.",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": ">=",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/LessThan.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/LessThan.schema.json",
44
"title": "LessThan",
55
"description": "Compare if the first argument is < the second argument.",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "<",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/LessThanOrEqualTo.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/LessThanOrEqualTo.schema.json",
44
"title": "LessThanOrEqualTo",
55
"description": "Compare if the first argument is < the second argument.",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "<=",
7+
"$ref": "schema.json#/definitions/operation"
78
}

schemas/Multiply.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"$id": "https://www.flippercloud.io/expressions/Multiply.schema.json",
44
"title": "Multiply",
55
"description": "Multiply two values",
6-
"$ref": "schema.json#/definitions/arguments-two"
6+
"operator": "*",
7+
"$ref": "schema.json#/definitions/operation"
78
}

0 commit comments

Comments
 (0)