-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for non required const-properties (#82)
* Added support for non required const-properties * Replaced interface to abstract class * Added implementation of implicit null for constant properties * Changed the check setRequired * Remove modelData from check conditions * Added call generateValidators() and unit test * Replaced check with three conditions * Ensured the presence of the $modelData variable in the templates, added some unit tests --------- Co-authored-by: Kolodkin Valentin <kolodkin@playkot.com>
- Loading branch information
1 parent
1bb1374
commit 83acf61
Showing
12 changed files
with
283 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"property": { | ||
"oneOf": [ | ||
{ | ||
"const": "red" | ||
}, | ||
{ | ||
"const": 1 | ||
} | ||
] | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/Schema/ConstPropertyTest/ArrayItemConstProperty.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"property": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"const": "red" | ||
} | ||
] | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/Schema/ConstPropertyTest/NullValueConstProperty.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"nullProperty": { | ||
"const": null | ||
} | ||
}, | ||
"required": [ | ||
"nullProperty" | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/Schema/ConstPropertyTest/RequiredAndOptionalConstProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"requiredProperty": { | ||
"const": "red" | ||
}, | ||
"optionalProperty": { | ||
"const": "green" | ||
} | ||
}, | ||
"required": [ | ||
"requiredProperty" | ||
] | ||
} |