openvalidation.io
playground
GitHub
Search…
EN
open* what?
What drives us
Ready to go in 3 min.
Grammar
Rules
Variables
Comments
Schema and Data types
Functions
Arithmetic
Domain-specific operators
Lists
Structuring the set of rules
Keywords
Rules integration
Command Line Interface
API
Best practice
Examples
contribution
Contribution guide
Developer guide
OpenAPI Support
OpenAPI Codegen
OpenAPI Tutorial
openVALIDATION
Imprint
Privacy Policy
Powered By
GitBook
Arithmetic
The grammar supports arithmetic and mathematical operations:
1
20
-
18
2
AS
professional experience
Copied!
Of course, variables or attributes from the schema can also be used within an arithmetic operation.
Let's look at the following scheme and two predefined variables:
YAML
JSON
1
age
:
0
Copied!
1
{
2
age
:
0
3
}
Copied!
1
18
2
AS
career start
3
4
age
-
career start
5
AS
professional experience
Copied!
Arithmetic expressions can be arbitrarily complex using parentheses:
1
(
20
-
18
)
*
12
2
AS
professional experience
in
months
Copied!
Arithmetic expressions can also be used directly within a rule:
1
the professional experience from age
-
18
years
MUST
NOT
be
LESS
than
10
Copied!
Reference
Currently the following mathematical operations are supported:
Operator
Name
Discription
+
Addition
simple addition
-
Subtraction
simple subtraction
*
Multiplication
simple multiplication
/
Division
simple division
MOD
Modulo
remaining
more will be added soon...
Previous
Functions
Next
Domain-specific operators
Last modified
2yr ago
Copy link
Contents
Reference