Skip to content

Commit 3a046b8

Browse files
Merge pull request #3 from relogiclabs/develop
Update Data Type Validation
2 parents ed4e83b + 1da9e62 commit 3a046b8

File tree

241 files changed

+1279
-1080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+1279
-1080
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The next example represents an expanded version of the previous one, which bring
9090
} #object #null
9191
}
9292

93-
%define $tags: @length(1, 10) #array($tag)
93+
%define $tags: @length(1, 10) #string*($tag) #array
9494
%define $tag: @length(3, 20) @regex("[A-Za-z_]+") #string
9595

9696
%schema:
@@ -99,10 +99,9 @@ The next example represents an expanded version of the previous one, which bring
9999
"id": @range(1, 10000) #integer,
100100
/*username does not allow special characters*/
101101
"username": @regex("[a-z_]{3,30}") #string,
102-
/*currently only one role is allowed by system*/
103-
"role": "user" #string,
102+
"role": @enum("user", "admin") #string,
104103
"isActive": #boolean, //user account current status
105-
"registeredAt": #time,
104+
"registeredAt": @time("DD-MM-YYYY hh:mm:ss") #string,
106105
"profile": {
107106
"firstName": @regex("[A-Za-z]{3,50}") #string,
108107
"lastName": @regex("[A-Za-z]{3,50}") #string,
@@ -137,9 +136,9 @@ The subsequent JSON sample is an illustrative example that successfully validate
137136
"user": {
138137
"id": 1234,
139138
"username": "johndoe",
140-
"role": "user",
139+
"role": "admin",
141140
"isActive": true,
142-
"registeredAt": "2023-09-06T15:10:30.639Z",
141+
"registeredAt": "06-09-2023 15:10:30",
143142
"profile": {
144143
"firstName": "John",
145144
"lastName": "Doe",
@@ -196,20 +195,20 @@ The subsequent JSON sample is an illustrative example that successfully validate
196195
"id": "p1",
197196
"name": "Smartphone",
198197
"brand": "TechGiant",
199-
"price": 1.99,
198+
"price": 599.99,
200199
"inStock": true,
201200
"specs": null
202201
},
203202
{
204203
"id": "p2",
205204
"name": "Laptop",
206205
"brand": "SuperTech",
207-
"price": 159999.99,
206+
"price": 1299.99,
208207
"inStock": false,
209208
"specs": {
210-
"cpu": "Ryzen 01",
211-
"ram": "8GB",
212-
"storage": "256GB SSD"
209+
"cpu": "Ryzen 11",
210+
"ram": "11GB",
211+
"storage": "11GB SSD"
213212
}
214213
}
215214
],

doc/content/articles/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class SampleSchema {
8282
}
8383
```
8484
85-
## Create Some Validation Errors
85+
## Create Validation Errors
8686
Let's intentionally introduce a few errors by modifying the previous JSON document and then examine the validation results. To begin, we'll alter the `id` within the `user` object to a string type and observe the outcome. Additionally, we'll modify the `username` by inserting a space into its value, thus creating an invalid `username`. Below is the revised JSON representation, now containing these purposeful errors.
8787
```json
8888
{

doc/public/api/allclasses-index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>All Classes and Interfaces (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>All Classes and Interfaces (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="class index">
1010
<meta name="generator" content="javadoc/AllClassesIndexWriter">
1111
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

doc/public/api/allpackages-index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>All Packages (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>All Packages (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="package index">
1010
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
1111
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/JsonAssert.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>JsonAssert (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>JsonAssert (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="declaration: package: com.relogiclabs.json.schema, class: JsonAssert">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/JsonSchema.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>JsonSchema (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>JsonSchema (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="declaration: package: com.relogiclabs.json.schema, class: JsonSchema">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/class-use/JsonAssert.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>Uses of Class com.relogiclabs.json.schema.JsonAssert (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>Uses of Class com.relogiclabs.json.schema.JsonAssert (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="use: package: com.relogiclabs.json.schema, class: JsonAssert">
1010
<meta name="generator" content="javadoc/ClassUseWriter">
1111
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/class-use/JsonSchema.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>Uses of Class com.relogiclabs.json.schema.JsonSchema (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>Uses of Class com.relogiclabs.json.schema.JsonSchema (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="use: package: com.relogiclabs.json.schema, class: JsonSchema">
1010
<meta name="generator" content="javadoc/ClassUseWriter">
1111
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/collection/IndexHashMap.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>IndexHashMap (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>IndexHashMap (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="declaration: package: com.relogiclabs.json.schema.collection, class: IndexHashMap">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

doc/public/api/com/relogiclabs/json/schema/collection/IndexMap.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
22
<html lang="en">
33
<head>
4-
<!-- Generated by javadoc (17) on Sun Oct 08 19:24:58 BDT 2023 -->
5-
<title>IndexMap (New Json Schema 1.4.0 API)</title>
4+
<!-- Generated by javadoc (17) on Wed Oct 25 20:29:44 BDT 2023 -->
5+
<title>IndexMap (New Json Schema 1.5.0 API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8-
<meta name="dc.created" content="2023-10-08">
8+
<meta name="dc.created" content="2023-10-25">
99
<meta name="description" content="declaration: package: com.relogiclabs.json.schema.collection, interface: IndexMap">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

0 commit comments

Comments
 (0)