Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jessealama/json-pointer
Racket implementation of a JSON Pointer evaluator (RFC 6901)
https://github.com/jessealama/json-pointer
Last synced: 4 days ago
JSON representation
Racket implementation of a JSON Pointer evaluator (RFC 6901)
- Host: GitHub
- URL: https://github.com/jessealama/json-pointer
- Owner: jessealama
- License: isc
- Created: 2017-12-23T07:52:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-28T13:42:27.000Z (3 months ago)
- Last Synced: 2024-08-28T15:08:40.827Z (3 months ago)
- Language: Racket
- Size: 32.2 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE.txt
Awesome Lists containing this project
README
json-pointer
============raco pkg install json-pointer
JSON Pointer is a straightforward notation for referring to values embedded within a JSON document. Given a JSON object like this:
{
"foo": 5,
"bar": [ 1, 2 ]
}the JSON Pointer expression `/foo` has the value `5`, whereas the expressions `/bar/0` and `/bar/1` have the values `1` and `2`, respectively.
JSON Pointer is an IETF standard [RFC 6901][rfc].
Exports
----------This library exports five functions:
*Predicates*
* `json-pointer?` checks whether a string adheres to the syntax of JSON Pointer
* `json-pointer-expression?` checks whether a list is a suitable representation of the steps that make up a JSON Pointer expression*Parsing and rendering*
* `parse-json-pointer`: Produces a JSON Pointer expression from a JSON Pointer
* `expression->pointer`: Produces a JSON Pointer from a JSON Pointer expression*Evaluation*
* `json-pointer-value` takes two arguments: a JSON Pointer (`json-pointer?`, defined in this library) and a JSON document (`jsexpr?`, provided by the standard `json` module) and evaluates the JSON Pointer within the document.
[rfc]: https://tools.ietf.org/html/rfc6901