Skip to content

Commit

Permalink
add test script
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmd-azeez committed Dec 23, 2024
1 parent eace4fd commit c170589
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions servlets/json-schema/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.PHONY: run clean

# Build target with caching - only rebuilds if source files change
dist/plugin.wasm: $(shell find src -name '*.ts')
xtp plugin build

# Run the WordPress categories list command
run: dist/plugin.wasm
./test.sh

# Clean built files
clean:
rm -f dist/plugin.wasm

# Default target
.DEFAULT_GOAL := run
1 change: 1 addition & 0 deletions servlets/json-schema/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xtp plugin call ./dist/plugin.wasm --wasi --input '{ "params": { "name": "validate", "arguments": { "schema": {"$schema":"http://json-schema.org/draft-07/schema#","title":"Person","type":"object","properties":{"name":{"type":"string","description":"The person'\''s full name"},"age":{"type":"integer","minimum":0,"description":"The person'\''s age in years"},"isStudent":{"type":"boolean","description":"Whether the person is a student"}},"required":["name","age"]}, "document": {"name":"John Doe","age":25,"isStudent":true} } } }' call

0 comments on commit c170589

Please sign in to comment.