Crates.io | jsonprima |
lib.rs | jsonprima |
version | 0.3.0 |
source | src |
created_at | 2019-07-05 13:39:29.913381 |
updated_at | 2019-08-13 09:55:24.102321 |
description | RFC 8259 compliant JSON validator in Rust. |
homepage | https://github.com/jsonprima/jsonprima |
repository | https://github.com/jsonprima/jsonprima |
max_upload_size | |
id | 146549 |
size | 73,666 |
RFC 8259 compliant JSON validator in Rust.
Documentation:
This package can be used as library in Rust projects. See the API reference (docs.rs) for more info.
You can grab the latest release of the binary on GitHub.
Pass the JSON document to validate as argument using the -i
option.
$ jsonprima -i "[true, false]"
[]
The returned value is an JSON array with the returned errors as described bellow:
interface Error {
code: string,
description: string,
index_start: number,
index_end: number
}
In the above example the JSON document is valid, so the array does not contain any errors.
Here is an example of a wrong JSON document:
$ jsonprima -i "trua"
"[{\"code\": \"E105\", \"description\": \"Invalid character in literal name.\", \"index_end\": 4, \"index_start\": 0}]"
Note: This is a non-tolerant parser, expect that there will be at most one error in the returned array.
JSONPrima is primarily distributed under the terms of the MIT license.
See LICENSE.md for details.