-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add json-schema statement and example (#167)
* docs: add json-schema plugin statement to the list of all slangroom statements * docs(examples): add json-schema plugin example
- Loading branch information
1 parent
6bc0612
commit 28400d6
Showing
9 changed files
with
92 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
SPDX-License-Identifier: CC-BY-NC-SA-4.0 | ||
--> | ||
|
||
## json-schema plugin examples | ||
|
||
### validate json | ||
::: code-group | ||
<<< @/examples/json-schema/validate.zen{3 gherkin:line-numbers} | ||
<<< @/examples/json-schema/validate.data{json} | ||
<<< @/examples/json-schema/validate.keys{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,6 @@ | ||
{ | ||
"json_data": { | ||
"first_name": "Jhon", | ||
"last_name": "Doe" | ||
} | ||
} |
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,17 @@ | ||
{ | ||
"json_schema": { | ||
"type": "object", | ||
"properties": { | ||
"first_name": { | ||
"type": "string" | ||
}, | ||
"last_name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"first_name", | ||
"last_name" | ||
] | ||
} | ||
} |
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,6 @@ | ||
Rule unknown ignore | ||
|
||
Given I send json_data 'json_data' and send json_schema 'json_schema' and validate json and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
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 |
---|---|---|
@@ -1,30 +1,31 @@ | ||
{ | ||
"name": "statements", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@slangroom/core": "workspace:^", | ||
"@slangroom/db": "workspace:^", | ||
"@slangroom/ethereum": "workspace:^", | ||
"@slangroom/fs": "workspace:^", | ||
"@slangroom/git": "workspace:^", | ||
"@slangroom/helpers": "workspace:^", | ||
"@slangroom/http": "workspace:^", | ||
"@slangroom/oauth": "workspace:^", | ||
"@slangroom/pocketbase": "workspace:^", | ||
"@slangroom/qrcode": "workspace:^", | ||
"@slangroom/redis": "workspace:^", | ||
"@slangroom/shell": "workspace:^", | ||
"@slangroom/timestamp": "workspace:^", | ||
"@slangroom/wallet": "workspace:^", | ||
"@slangroom/zencode": "workspace:^", | ||
"markdown-table": "^3.0.3" | ||
} | ||
"name": "statements", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@slangroom/core": "workspace:^", | ||
"@slangroom/db": "workspace:^", | ||
"@slangroom/ethereum": "workspace:^", | ||
"@slangroom/fs": "workspace:^", | ||
"@slangroom/git": "workspace:^", | ||
"@slangroom/helpers": "workspace:^", | ||
"@slangroom/http": "workspace:^", | ||
"@slangroom/json-schema": "workspace:^", | ||
"@slangroom/oauth": "workspace:^", | ||
"@slangroom/pocketbase": "workspace:^", | ||
"@slangroom/qrcode": "workspace:^", | ||
"@slangroom/redis": "workspace:^", | ||
"@slangroom/shell": "workspace:^", | ||
"@slangroom/timestamp": "workspace:^", | ||
"@slangroom/wallet": "workspace:^", | ||
"@slangroom/zencode": "workspace:^", | ||
"markdown-table": "^3.0.3" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.