Skip to content

Commit

Permalink
Update project name to JSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
zhossain-info committed Jan 22, 2024
1 parent 8fff9b9 commit e0edfbc
Show file tree
Hide file tree
Showing 31 changed files with 397 additions and 397 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Let's explore an example of our schema for a typical JSON API response containin
}
}
```
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).
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).
```json
{
"user": {
Expand All @@ -63,7 +63,7 @@ In the above example, two types of constraints are used: constraint functions (a
}
```
## Extended Example
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).
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).
```cpp
%title: "Extended User Profile Dashboard API Response"
%version: 2.0.0
Expand Down Expand Up @@ -224,4 +224,4 @@ The subsequent JSON sample is an illustrative example that successfully validate
}
}
```
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).
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).
2 changes: 1 addition & 1 deletion doc/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ date = 2023-10-08T09:38:53+06:00
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).

<div class="banner-image">
<img src="/JsonSchema-Java/images/json-schema.webp" alt="New Json Schema">
<img src="/JSchema-Java/images/json-schema.webp" alt="New Json Schema">
</div>
4 changes: 2 additions & 2 deletions doc/content/articles/datatypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ The date-time data type serves as the parent data type for both date and time ty
```

### The Date Data Type
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:
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:
```html
#date
```

### The Time Data Type
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:
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:
```html
#time
```
Expand Down
6 changes: 3 additions & 3 deletions doc/content/articles/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ The default value of this directive is `false`, which means that by default, und
```

### Date Data Type Format
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:
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:
```js
%pragma DateDataTypeFormat: "DD-MM-YYYY"
```

### Time Data Type Format
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:
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:
```js
%pragma TimeDataTypeFormat: "DD-MM-YYYY hh:mm:ss"
```
Expand All @@ -69,7 +69,7 @@ The `IgnoreObjectPropertyOrder` pragma directive provides a means to enforce a s
## Definition / Define Directive
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.

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).
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).

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:
```js
Expand Down
4 changes: 2 additions & 2 deletions doc/content/articles/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ Validates whether the `target` string is a valid phone number. It follows the IT
```stylus
#string target - @date(pattern)
```
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.
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.

```
#string target - @time(pattern)
```
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).
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).

### Date and Time Range
```stylus
Expand Down
20 changes: 10 additions & 10 deletions doc/content/articles/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ weight = 1
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.
<br/>

* <font size="4">[Getting Started & Installation](/JsonSchema-Java/articles/quickstart)</font>
* <font size="4">[Validation Syntax & Format](/JsonSchema-Java/articles/validation)</font>
* <font size="4">[Validation Directives & Pragmas](/JsonSchema-Java/articles/directives)</font>
* <font size="4">[Schema Specification & Grammar](/JsonSchema-Java/articles/specification)</font>
* <font size="4">[Data Types & Validation](/JsonSchema-Java/articles/datatypes)</font>
* <font size="4">[Functions & Validation](/JsonSchema-Java/articles/functions)</font>
* <font size="4">[Date & Time Patterns](/JsonSchema-Java/articles/datetime)</font>
* <font size="4">[Reusable Components of Validation](/JsonSchema-Java/articles/components)</font>
* <font size="4">[Build from Source Code](/JsonSchema-Java/articles/sourcebuild)</font>
* <font size="4">[API Reference Documentation](/JsonSchema-Java/api/index.html)</font>
* <font size="4">[Getting Started & Installation](/JSchema-Java/articles/quickstart)</font>
* <font size="4">[Validation Syntax & Format](/JSchema-Java/articles/validation)</font>
* <font size="4">[Validation Directives & Pragmas](/JSchema-Java/articles/directives)</font>
* <font size="4">[Schema Specification & Grammar](/JSchema-Java/articles/specification)</font>
* <font size="4">[Data Types & Validation](/JSchema-Java/articles/datatypes)</font>
* <font size="4">[Functions & Validation](/JSchema-Java/articles/functions)</font>
* <font size="4">[Date & Time Patterns](/JSchema-Java/articles/datetime)</font>
* <font size="4">[Reusable Components of Validation](/JSchema-Java/articles/components)</font>
* <font size="4">[Build from Source Code](/JSchema-Java/articles/sourcebuild)</font>
* <font size="4">[API Reference Documentation](/JSchema-Java/api/index.html)</font>

<br/>
2 changes: 1 addition & 1 deletion doc/content/articles/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ Actual (Json Line: 3:14): found #string inferred by "not number"
at org.example.SampleSchema.checkIsValid(SampleSchema.java:64)
at org.example.Main.main(Main.java:5)
```
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JSchema-Java/api/index.html).
6 changes: 3 additions & 3 deletions doc/content/articles/sourcebuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ This comprehensive guide illustrates the procedures for retrieving source code f
## Build the Library
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:
```shell
git clone https://github.com/relogiclabs/JsonSchema-Java.git
git clone https://github.com/relogiclabs/JSchema-Java.git
```
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:
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:

```shell
mvn clean install
Expand Down Expand Up @@ -173,4 +173,4 @@ Actual (Json Line: 3:14): found #string inferred by "not number"
at org.example.SampleSchema.checkIsValid(SampleSchema.java:64)
at org.example.Main.main(Main.java:5)
```
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JsonSchema-Java/api/index.html).
For more information about the schema syntax format and library functionalities, please refer to the reference documentation [here](/JSchema-Java/api/index.html).
2 changes: 1 addition & 1 deletion doc/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "https://relogiclabs.github.io/JsonSchema-Java"
baseURL = "https://relogiclabs.github.io/JSchema-Java"
languageCode = "en-us"
title = "New Json Schema"

Expand Down
8 changes: 4 additions & 4 deletions doc/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<link rel="stylesheet" href="/JsonSchema-Java/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="/JsonSchema-Java/css/syntax.css" type="text/css" media="all" />
<link rel="icon" href="/JsonSchema-Java/images/favicon.ico">
<link rel="stylesheet" href="/JSchema-Java/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="/JSchema-Java/css/syntax.css" type="text/css" media="all" />
<link rel="icon" href="/JSchema-Java/images/favicon.ico">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="/JsonSchema-Java/js/script.js"></script>
<script src="/JSchema-Java/js/script.js"></script>
8 changes: 4 additions & 4 deletions doc/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<span class="menu-icon icon-bar3"></span>
</div>
</label>
<a href="https://www.relogiclabs.com"><img src="/JsonSchema-Java/images/logo.svg" alt="Relogic Labs"></a>
<a href="https://www.relogiclabs.com"><img src="/JSchema-Java/images/logo.svg" alt="Relogic Labs"></a>
</div>
<div class="header-right">
<a href="/JsonSchema-Java">Home</a>
<a href="/JsonSchema-Java/api/index.html">API Reference</a>
<a href="https://github.com/relogiclabs/JsonSchema-Java">GitHub</a>
<a href="/JSchema-Java">Home</a>
<a href="/JSchema-Java/api/index.html">API Reference</a>
<a href="https://github.com/relogiclabs/JSchema-Java">GitHub</a>
</div>
</nav>
</header>
Loading

0 comments on commit e0edfbc

Please sign in to comment.