-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move plugin and schema.json out of internal repo
This moves the schema.json out into the light and puts it with the rest of the parsing and validating code where it belongs. Since they change together and we should publish them together. I removed checkfile related things from the plugin, we can decide what to do about that. I also moved the JSON Schema checks to inside this library instead of being in the plugin. We should add more unit testing on this library to exercise and improve the JSON schema validation. We can add some light XTP plugin tests to make sure that the plugin is still working as behaving, but not going so far as to create a lot of individual test cases that couple the wasm level tests to the implementation details of things like features and error messages.
- Loading branch information
Showing
9 changed files
with
683 additions
and
45 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,31 @@ | ||
# XTP Schema Plugin | ||
|
||
The XTP schema plugin is an wrapper around xtp-bindgen. It packages up | ||
some of the functionality of the library into an Extism plugin. | ||
|
||
It has 3 exports: | ||
|
||
* validate_schema | ||
* get_json_schema | ||
* has_imports | ||
|
||
## Usage | ||
|
||
Compile: | ||
|
||
``` | ||
xtp plugin build | ||
``` | ||
|
||
Run: | ||
|
||
``` | ||
cat ../example-schema.yaml | xtp plugin call dist/plugin.wasm validate_schema --stdin --wasi | jq | ||
{ | ||
"valid": true, | ||
//.... | ||
} | ||
``` | ||
|
||
|
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
Oops, something went wrong.