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: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Let's explore an example of our schema for a typical JSON API response containin
37
37
}
38
38
}
39
39
```
40
-
In the above example, two types of constraints are used: constraint functions (also referred to as validation functions, such as `@range(1, 10000)`) and constraint data types (also referred to as validation data types, such as `#integer`). All constraint functions begin with the `@` symbol, while all constraint data types start with `#`. C-style comments are also supported within the schema. In this example, `address` can be `null` (like an optional input for users) and if it is `null` then no constraints of `address` are applicable. The following JSON is one of the examples that will be successfully validated against the above schema. To start your journey with the JSON validation library, please consult the documentation available [here](https://relogiclabs.github.io/JsonSchema-Java/articles/intro).
40
+
In the above example, two types of constraints are used: constraint functions (also referred to as validation functions, such as `@range(1, 10000)`) and constraint data types (also referred to as validation data types, such as `#integer`). All constraint functions begin with the `@` symbol, while all constraint data types start with `#`. C-style comments are also supported within the schema. In this example, `address` can be `null` (like an optional input for users) and if it is `null` then no constraints of `address` are applicable. The following JSON is one of the examples that will be successfully validated against the above schema. To start your journey with the JSON validation library, please consult the documentation available [here](https://relogiclabs.github.io/JSchema-Java/articles/intro).
41
41
```json
42
42
{
43
43
"user": {
@@ -63,7 +63,7 @@ In the above example, two types of constraints are used: constraint functions (a
63
63
}
64
64
```
65
65
## Extended Example
66
-
The next example represents an expanded version of the previous one, which brings more complexity. To effectively construct such schemas with multiple layers of nested structures, it's beneficial to have a fundamental understanding of this schema format. While the syntax may seem difficult at first, it becomes straightforward once you have a basic understanding of it. For more detailed information, reference documentation is available [here](https://relogiclabs.github.io/JsonSchema-Java/articles/intro).
66
+
The next example represents an expanded version of the previous one, which brings more complexity. To effectively construct such schemas with multiple layers of nested structures, it's beneficial to have a fundamental understanding of this schema format. While the syntax may seem difficult at first, it becomes straightforward once you have a basic understanding of it. For more detailed information, reference documentation is available [here](https://relogiclabs.github.io/JSchema-Java/articles/intro).
67
67
```cpp
68
68
%title: "Extended User Profile Dashboard API Response"
69
69
%version: 2.0.0
@@ -224,4 +224,4 @@ The subsequent JSON sample is an illustrative example that successfully validate
224
224
}
225
225
}
226
226
```
227
-
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](https://relogiclabs.github.io/JsonSchema-Java/api/index.html).
227
+
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](https://relogiclabs.github.io/JSchema-Java/api/index.html).
Copy file name to clipboardExpand all lines: doc/content/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,5 +7,5 @@ date = 2023-10-08T09:38:53+06:00
7
7
The New JSON Schema prioritizes simplicity, conciseness, and readability, making it user-friendly and accessible without the need for extensive prior knowledge. It offers efficient read-write facilities, precise JSON document definition through various data types and functions, and extensibility to meet modern web service diverse requirements. For a comprehensive overview of this JSON Schema, we invite you to explore our dedicated post available [here](https://www.relogiclabs.com/p/json-schema.html).
Copy file name to clipboardExpand all lines: doc/content/articles/datatypes.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,13 +80,13 @@ The date-time data type serves as the parent data type for both date and time ty
80
80
```
81
81
82
82
### The Date Data Type
83
-
The date data type accepts a string representation of a date, conforming to the ISO 8601 standard (date part only). This is the default configuration, which can be modified using the directive described [here](/JsonSchema-Java/articles/directives). It is a subtype of date-time type and thus also formatted as per the JSON string specification. Detailed explanations of the ISO 8601 standard can be found in this [document](https://www.iso.org/iso-8601-date-and-time-format.html). Furthermore, you can refer to this [document](/JsonSchema-Java/articles/datetime) for a detailed description of the date pattern associated with this data type. To define this data type in schema, use the following syntax:
83
+
The date data type accepts a string representation of a date, conforming to the ISO 8601 standard (date part only). This is the default configuration, which can be modified using the directive described [here](/JSchema-Java/articles/directives). It is a subtype of date-time type and thus also formatted as per the JSON string specification. Detailed explanations of the ISO 8601 standard can be found in this [document](https://www.iso.org/iso-8601-date-and-time-format.html). Furthermore, you can refer to this [document](/JSchema-Java/articles/datetime) for a detailed description of the date pattern associated with this data type. To define this data type in schema, use the following syntax:
84
84
```html
85
85
#date
86
86
```
87
87
88
88
### The Time Data Type
89
-
The time data type accepts a string representation of a time (including both date and time parts), in accordance with the ISO 8601 standard. This default configuration can be modified using the directive described [here](/JsonSchema-Java/articles/directives). Similar to the date data type, it is a subtype of date-time data type and thus also formatted as per the JSON string specification. Here is the ISO 8601 standard [document](https://www.iso.org/iso-8601-date-and-time-format.html), which contains detailed explanations. Furthermore, you can refer to this [document](/JsonSchema-Java/articles/datetime) for a detailed description of the date-time pattern associated with this data type. To define this data type in schema, use the following syntax:
89
+
The time data type accepts a string representation of a time (including both date and time parts), in accordance with the ISO 8601 standard. This default configuration can be modified using the directive described [here](/JSchema-Java/articles/directives). Similar to the date data type, it is a subtype of date-time data type and thus also formatted as per the JSON string specification. Here is the ISO 8601 standard [document](https://www.iso.org/iso-8601-date-and-time-format.html), which contains detailed explanations. Furthermore, you can refer to this [document](/JSchema-Java/articles/datetime) for a detailed description of the date-time pattern associated with this data type. To define this data type in schema, use the following syntax:
Copy file name to clipboardExpand all lines: doc/content/articles/directives.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,13 @@ The default value of this directive is `false`, which means that by default, und
43
43
```
44
44
45
45
### Date Data Type Format
46
-
The `DateDataTypeFormat` pragma directive enables you to customize the default format of the `#date` data type. By default, the `#date` data type follows the ISO 8601 standard, precisely using the format `YYYY-MM-DD`. Additional details on date-time patterns and formats are available [here](/JsonSchema-Java/articles/datetime). The subsequent example illustrates the process of defining a customized date format for the `#date` data type:
46
+
The `DateDataTypeFormat` pragma directive enables you to customize the default format of the `#date` data type. By default, the `#date` data type follows the ISO 8601 standard, precisely using the format `YYYY-MM-DD`. Additional details on date-time patterns and formats are available [here](/JSchema-Java/articles/datetime). The subsequent example illustrates the process of defining a customized date format for the `#date` data type:
47
47
```js
48
48
%pragma DateDataTypeFormat:"DD-MM-YYYY"
49
49
```
50
50
51
51
### Time Data Type Format
52
-
To customize the default format of the `#time` data type, utilize the `TimeDataTypeFormat` pragma directive. By default, the `#time` data type follows the ISO 8601 standard, precisely in the format `YYYY-MM-DD'T'hh:mm:ss.FZZ`. Further information on date-time patterns and formats can be found [here](/JsonSchema-Java/articles/datetime). The following example demonstrates how to specify a customized time format for the `#time` data type:
52
+
To customize the default format of the `#time` data type, utilize the `TimeDataTypeFormat` pragma directive. By default, the `#time` data type follows the ISO 8601 standard, precisely in the format `YYYY-MM-DD'T'hh:mm:ss.FZZ`. Further information on date-time patterns and formats can be found [here](/JSchema-Java/articles/datetime). The following example demonstrates how to specify a customized time format for the `#time` data type:
53
53
```js
54
54
%pragma TimeDataTypeFormat:"DD-MM-YYYY hh:mm:ss"
55
55
```
@@ -69,7 +69,7 @@ The `IgnoreObjectPropertyOrder` pragma directive provides a means to enforce a s
69
69
## Definition / Define Directive
70
70
This feature in JSON schemas allows you to define a name for a component or fragment of schema or validation rules, which can be referenced from various parts of your schema. This means that if you encounter similar validation requirements in different sections of your schema, you can conveniently refer to the named component instead of duplicating the same validation rules.
71
71
72
-
By providing clear and descriptive names for these validation rules or sub-schemas, you can enhance the overall clarity and context of your schema. This clarity not only makes it easier to understand the structure and intent of the schema but also contributes to keeping your complex schema well-organized, concise, and more manageable. For more information about the schema component syntax and format, please refer to the documentation [here](/JsonSchema-Java/articles/components).
72
+
By providing clear and descriptive names for these validation rules or sub-schemas, you can enhance the overall clarity and context of your schema. This clarity not only makes it easier to understand the structure and intent of the schema but also contributes to keeping your complex schema well-organized, concise, and more manageable. For more information about the schema component syntax and format, please refer to the documentation [here](/JSchema-Java/articles/components).
73
73
74
74
The name or alias of the directive is always start with `$` which also refers to that they are named fragment defined elsewhere in the schema. Here is a simple example of how to use this directive:
Copy file name to clipboardExpand all lines: doc/content/articles/functions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,12 +179,12 @@ Validates whether the `target` string is a valid phone number. It follows the IT
179
179
```stylus
180
180
#string target - @date(pattern)
181
181
```
182
-
Validates that the `target` string matches the date and time pattern specified by the `pattern` parameter. It fully supports the ISO 8601 date and time format. Beyond this standard, it also allows custom date and time formats, ensuring compatibility with various systems and meeting diverse users and businesses requirements. This [document](/JsonSchema-Java/articles/datetime) provides a comprehensive overview of the date-time custom patterns.
182
+
Validates that the `target` string matches the date and time pattern specified by the `pattern` parameter. It fully supports the ISO 8601 date and time format. Beyond this standard, it also allows custom date and time formats, ensuring compatibility with various systems and meeting diverse users and businesses requirements. This [document](/JSchema-Java/articles/datetime) provides a comprehensive overview of the date-time custom patterns.
183
183
184
184
```
185
185
#string target - @time(pattern)
186
186
```
187
-
Both the `@date` and `@time` functions support a complete range of date-time patterns, enabling the precise definition of any date and time scenario. Therefore, these functions can be used interchangeably. When the sole consideration is the date or day of the month in a year, employing the `@date` function is the more convenient choice. In contrast, when it becomes necessary to specify a particular time on a date, the `@time` function is the more appropriate option. To learn more about date-time patterns, please refer to [this page](/JsonSchema-Java/articles/datetime).
187
+
Both the `@date` and `@time` functions support a complete range of date-time patterns, enabling the precise definition of any date and time scenario. Therefore, these functions can be used interchangeably. When the sole consideration is the date or day of the month in a year, employing the `@date` function is the more convenient choice. In contrast, when it becomes necessary to specify a particular time on a date, the `@time` function is the more appropriate option. To learn more about date-time patterns, please refer to [this page](/JSchema-Java/articles/datetime).
Copy file name to clipboardExpand all lines: doc/content/articles/intro.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ weight = 1
8
8
JSON, short for JavaScript Object Notation, is one of the most widely used data exchange formats that are both user-friendly and machine-readable. New JSON Schema is a practical tool for defining and validating the structure of JSON documents. It allows you to specify the expected format, data types, and constraints of JSON data. The following guides offer comprehensive details about the New JSON Schema. This document provides a list of links, each corresponding to a specific detail document available in this project.
9
9
<br/>
10
10
11
-
* <fontsize="4">[Getting Started & Installation](/JsonSchema-Java/articles/quickstart)</font>
Copy file name to clipboardExpand all lines: doc/content/articles/quickstart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,4 +162,4 @@ Actual (Json Line: 3:14): found #string inferred by "not number"
162
162
at org.example.SampleSchema.checkIsValid(SampleSchema.java:64)
163
163
at org.example.Main.main(Main.java:5)
164
164
```
165
-
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
165
+
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JSchema-Java/api/index.html).
Copy file name to clipboardExpand all lines: doc/content/articles/sourcebuild.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ This comprehensive guide illustrates the procedures for retrieving source code f
10
10
## Build the Library
11
11
To get started, clone the project from the following URL using your preferred Git client (command line or GUI). You can open a terminal and enter the following Git clone command as shown below:
Next, navigate to the project root directory of the `JsonSchema-Java` that you just cloned. Inside the directory, you should find a `pom.xml` file. This file contains the project configuration and dependencies required to build the library. Use the `cd` command to enter the project root directory and execute the following Maven command to build the Json Schema library:
15
+
Next, navigate to the project root directory of the `JSchema-Java` that you just cloned. Inside the directory, you should find a `pom.xml` file. This file contains the project configuration and dependencies required to build the library. Use the `cd` command to enter the project root directory and execute the following Maven command to build the Json Schema library:
16
16
17
17
```shell
18
18
mvn clean install
@@ -173,4 +173,4 @@ Actual (Json Line: 3:14): found #string inferred by "not number"
173
173
at org.example.SampleSchema.checkIsValid(SampleSchema.java:64)
174
174
at org.example.Main.main(Main.java:5)
175
175
```
176
-
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
176
+
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JSchema-Java/api/index.html).
0 commit comments