0.0.7 • Published 4 years ago

@d.horiyama/yaml_schema v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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
0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago