23andMe / Yamale

A schema and validator for YAML.
MIT License
672 stars 88 forks source link

Bug:map( key=validator ) dont work at all, it just say true #100

Closed adelin-b closed 4 years ago

adelin-b commented 4 years ago

To reproduce paste this in terminal

echo "
map1: include('test1')
map2: include('test2')
---
test1: map(str(), key=int())
test2: map(str(), key=regex('a*'))
" > test-schema.yaml;

# Actually anything passed into the key validator doesnt do anything
echo "
map1:
  key: <- this key isnt an integer,
map2:
  key: <- this key is not a valid regex match
" > test.yaml;
yamale -s test-schema.yaml test.yaml --strict

This command should fail because the key validator should not validate, but it is always passing.

mildebrandt commented 4 years ago

Hi, thanks for using Yamale. This functionality hasn't been released yet...it is only on the master branch. Did you try this on the master branch, or are you using the latest released version?

mildebrandt commented 4 years ago

We've released version 2.1.0 which includes support for the key constraint in the map validator. Let us know if there's still issues using it.