You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/content/articles/directives.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ In a schema, the version directive is used to provide a version number of the sc
28
28
## Include Directive
29
29
Include directive enables the addition or inclusion of a class, as defined by object-oriented programming, to a schema along with a set of methods that have specific signatures for performing custom validations. This feature extends the built-in validation capabilities of the schema. The example below illustrates how to utilize the include directive in Java language:
Copy file name to clipboardExpand all lines: doc/content/articles/functions.md
+27-15Lines changed: 27 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -102,11 +102,11 @@ If either the parameter values for `minimum` or `maximum` are unspecified or und
102
102
```
103
103
Validates that the `target` number is greater than or equal to the `minimum` number specified as a parameter, unless the `exclusive` parameter flag is explicitly set to `true`, in which case the `target` number must be exclusively greater than the `minimum` number.
@@ -115,11 +115,11 @@ Validates that the `target` number is greater than or equal to the `minimum` num
115
115
```
116
116
Validates that the `target` number is less than or equal to the `maximum` number specified as a parameter, unless the `exclusive` parameter flag is explicitly set to `true`, in which case the `target` number must be exclusively less than the `maximum` number.
@@ -230,17 +230,29 @@ Validates that the `target` date-time is exclusively before the `reference` date
230
230
```
231
231
Validates that the `target` date-time is exclusively after the `reference` date-time. If the `target` date-time finds on or before the `reference` date-time, a validation error is triggered. The `reference` parameter must be the string representation of the `target` data type, which can either be a `#date` or `#time` type.
232
232
233
-
### Number Positive
233
+
### Number Positive and Negative
234
234
```stylus
235
235
#number target - @positive
236
+
#number target - @positive(#number reference)
236
237
```
237
-
Validates that the `target` number is positive. If the `target` number is zero or negative, it generates a validation error.
238
+
Validates that the `target` number is positive or positive from (or relative to) the specified `reference`. If the `target` number is zero or negative for the first definition or less than the `reference` for the second definition, it generates a validation error.
238
239
239
-
### Number Negative
240
240
```stylus
241
241
#number target - @negative
242
-
```
243
-
Validates that the `target` number is negative. If the `target` number is zero or positive, it generates a validation error.
242
+
#number target - @negative(#number reference)
243
+
```
244
+
Validates that the `target` number is negative or negative from (or relative to) the specified `reference`. If the `target` number is zero or positive for the first definition or greater than the `reference` for the second definition, it generates a validation error.
Copy file name to clipboardExpand all lines: doc/content/articles/sourcebuild.md
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -158,17 +158,20 @@ com.relogiclabs.json.schema.exception.JsonSchemaException: DTYP04: Data type mis
158
158
Expected (Schema Line: 6:31): data type #integer
159
159
Actual (Json Line: 3:14): found #string inferred by "not number"
160
160
161
-
at com.relogiclabs.json.schema.types.JDataType.matchForReport(JDataType.java:86)
162
-
at com.relogiclabs.json.schema.types.JDataType.matchForReport(JDataType.java:68)
163
-
at com.relogiclabs.json.schema.types.JValidator.matchDataType(JValidator.java:67)
164
-
at com.relogiclabs.json.schema.types.JValidator.match(JValidator.java:57)
165
-
at com.relogiclabs.json.schema.types.JObject.match(JObject.java:55)
166
-
at com.relogiclabs.json.schema.types.JValidator.match(JValidator.java:52)
167
-
at com.relogiclabs.json.schema.types.JObject.match(JObject.java:55)
168
-
at com.relogiclabs.json.schema.types.JValidator.match(JValidator.java:52)
169
-
at com.relogiclabs.json.schema.types.JRoot.match(JRoot.java:47)
170
-
at com.relogiclabs.json.schema.JsonAssert.isValid(JsonAssert.java:54)
161
+
at com.relogiclabs.json.schema.type.JDataType.matchForReport(JDataType.java:90)
162
+
at com.relogiclabs.json.schema.type.JDataType.matchForReport(JDataType.java:72)
163
+
at com.relogiclabs.json.schema.type.JValidator.lambda$matchDataType$4(JValidator.java:74)
164
+
at com.relogiclabs.json.schema.type.JValidator.matchDataType(JValidator.java:74)
165
+
at com.relogiclabs.json.schema.type.JValidator.match(JValidator.java:64)
166
+
at com.relogiclabs.json.schema.type.JObject.match(JObject.java:57)
167
+
at com.relogiclabs.json.schema.type.JValidator.match(JValidator.java:59)
168
+
at com.relogiclabs.json.schema.type.JObject.match(JObject.java:57)
169
+
at com.relogiclabs.json.schema.type.JValidator.match(JValidator.java:59)
170
+
at com.relogiclabs.json.schema.type.JRoot.match(JRoot.java:50)
171
+
at com.relogiclabs.json.schema.tree.SchemaTree.match(SchemaTree.java:33)
172
+
at com.relogiclabs.json.schema.JsonAssert.isValid(JsonAssert.java:61)
173
+
at com.relogiclabs.json.schema.JsonAssert.isValid(JsonAssert.java:72)
171
174
at org.example.SampleSchema.checkIsValid(SampleSchema.java:64)
172
175
at org.example.Main.main(Main.java:5)
173
176
```
174
-
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
177
+
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
0 commit comments