https://github.com/notmgsk/cl-json-schema
https://github.com/notmgsk/cl-json-schema
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/notmgsk/cl-json-schema
- Owner: notmgsk
- License: mit
- Created: 2021-01-24T23:56:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-24T23:57:03.000Z (over 4 years ago)
- Last Synced: 2025-01-31T23:26:49.831Z (4 months ago)
- Language: Common Lisp
- Size: 27.3 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cl-json-schema
### _Mark Skilbeck _A Common-Lisp library to validate your [JSON schema](https://json-schema.org/ "JSON schema").
## Documentation
The main entrypoint is `(cl-json-schema:validate thing schema)` where `thing` is a JSON-compatible
value, and `schema` is a `hash-table`. (Alternatively, if you prefer, `(json-schema:validate thing
schema)`.For example
```common-lisp
(let ((schema (yason:parse "{
\"type\": \"object\",
\"propertyNames\": {
\"pattern\": \"^[A-Za-z_][A-Za-z0-9_]*$\"
}
}
")))
;; NEAT!
(json-schema:validate (yason:parse "{\"_a_proper_token_001\": \"value\"}")
schema)
;; NO BUENO! Key does not match the required pattern
(json-schema:validate (yason:parse "{\"001 invalid\": \"value\"}")
schema))
```## License
MIT. See `LICENSE`.