age
whose type
is number
. Although the schema is fairly simple the corresponding JSON schema file has a certain complexity to it. Especially if the schema becomes more complicated the amount of complexity skyrockets. However, for such straightforward schemas a simple JSON Object format can be specified from which the above schema is then derived. This is useful if you quickly want to try something out without having such unnecessary complexity stand in your way. The derivation of the following JSON Object creates the above schema:age
contains a numerical value of 0
. You can also pass other numerical values, since it will be ignored and is only used to determine the data type of the attribute.city
without specifying the full name address.city
like in a formal programming language. If city
occurs more than once in the schema, it will be validated later and the user will get a compiler message that he has to use the full name because of ambiguity."Instead of forcing humans to understand the complex inner workings of machines, we should construct machines in a way, so they better understand us humans"
age
attribute is used in these rules, but the schema only contains the attribute name
. The age
attribute cannot or must not be found. In this case the openVALIDATION compiler must not generate any program code. At this point, the compiler must throw a corresponding error message: e.g. "The rule must contain at least one attribute from the schema" or something like that. In order for such an error message to be thrown, the AST must be checked accordingly.