@d.horiyama/yaml_schema
Specify YAML by JSON Schema v7 in YAML.
Last updated 16 days ago by d.horiyama .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @d.horiyama/yaml_schema 
SYNC missed versions from official npm registry.

examples/object/schema.yaml

$schema: "http://json-schema.org/draft-07/schema#"
type: object
properties:
  name:
    type: "string"
  address:
    type: "object"
    properties:
      lines:
        type: "array"
        items:
          type: "string"
      zip:
        type: "string"
      city:
        type: "string"
      country:
        type: "string"
    required:
      - "country"
  votes:
    type: "integer"
    minimum: 1

examples/object/input.yaml

name: "Barack Obama"
address:
  lines:
    - "1600 Pennsylvania Avenue Northwest"
  zip: "DC 20500"
  # country: "USA"
  city: "Washington"
votes: "lots"
  • validation
cat examples/object/input.yaml | node dist/index.js -s examples/object/schema.yaml
data/address should have required property 'country'
data/votes should be integer

Current Tags

  • 0.0.7                                ...           latest (16 days ago)

1 Versions

  • 0.0.7                                ...           16 days ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 40
Dependencies (6)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |