项目作者: gerald1248

项目描述 :
validate YAML files using JSON schema
高级语言: Go
项目地址: git://github.com/gerald1248/validate-yaml.git
创建时间: 2019-05-09T16:25:22Z
项目社区:https://github.com/gerald1248/validate-yaml

开源协议:MIT License

下载


validate-yaml

Go Report Card

validate-yaml performs JSON Schema validation for YAML files. Under the hood, validation is always against a JSON schema. The YAML input is converted to JSON and then checked against the schema.

In fact, both schema and input files may be YAML documents.

JSON YAML
schema document
input document

Usage

  1. $ validate-yaml -h
  2. USAGE validate-yaml [-schema=PATH] FILE [FILE]
  3. -schema string
  4. path to JSON schema definition
  5. $ validate-yaml --schema=schema.json valid.yaml
  6. Loading schema schema.json...
  7. Validating valid.yaml...
  8. OK

Alternatively, you could enter:

  1. $ cat valid.yaml | validate-yaml --schema=schema.yaml
  2. Loading schema schema.yaml...
  3. Validating stream...
  4. OK