Crates.io | yamlcheck |
lib.rs | yamlcheck |
version | |
source | src |
created_at | 2023-03-09 15:34:44.007318 |
updated_at | 2024-12-04 15:10:31.799273 |
description | yamlcheck is a cli to validate a yaml file against a json schema |
homepage | https://github.com/Chevdor/yamlcheck |
repository | https://github.com/Chevdor/yamlcheck |
max_upload_size | |
id | 805738 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A CLI based on valico to check a YAML file using a json schema.
cargo install yamlcheck
Well.. nothing to install. An alias at most:
alias yamlcheck='podman run --rm -t docker.io/chevdor/yamlcheck'
samples/01/file.yaml
:
name: Bob
age: 30
comment: |
This is a comment.
It can be multiple lines.
samples/01/schema.json
:
{
"$schema": "https://json-schema.org/draft/2020-12/schema#",
"title": "Sample Schema",
"description": "Sample Schema",
"type": "object",
"additionalProperties": true,
"properties": {
"name": {
"type": "string",
"description": "Name"
},
"age": {
"description": "Some numbers",
"type": "number"
},
"comment": {
"description": "Optional: Some comment",
"type": "string"
}
},
"required": [
"name",
"age"
]
}
Sample run:
SCHEMA=samples/01/schema.json
YAML=samples/01/file.yaml
yamlcheck check -s $SCHEMA --file $YAML
Output:
valid : true
strictly valid : true