23andMe / Yamale

A schema and validator for YAML.
MIT License
680 stars 89 forks source link

Validate List of maps #97

Closed eXpire163 closed 4 years ago

eXpire163 commented 4 years ago

No way to validate a list of maps

yaml:

childs:
  - name: foo
    age: 3
  - name: bar
    age: 5

not working schema

childs: list(map())
childs: list(include(childs))
---
childs:
  name: str()
  age: int()
mildebrandt commented 4 years ago

Hi, thanks for using Yamale.

For your last example, don't forget to use quotes...for example:

childs: list(include('childs'))
---
childs:
  name: str()
  age: int()

As for this schema:

childs: list(map())

It validates correctly for me with the latest master and with 2.0.1. What version are you using and what is the error you're getting?

eXpire163 commented 4 years ago

yes, the quotes made my day

thanks