@d.horiyama/yaml_schema
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @d.horiyama/yaml_schema

Weekly Downloads

4

Version

0.0.7

License

MIT

Unpacked Size

10.5 kB

Total Files

16

Last publish

Collaborators

  • d.horiyama