disarm-platform / config-validation

Library to handle validation of configs
MIT License
0 stars 0 forks source link

add rule: check 'filter_field' property #15

Closed onlyjsmith closed 5 years ago

onlyjsmith commented 6 years ago

if record_point has 'filter_field' property, it must exist in the form_field.

Would be great if we can find a way to document this at the same time, i.e. this additional piece of the config.

onlyjsmith commented 6 years ago

Started branch 15-add-rule-filter-field-property

Having trouble with const filter_field_exists = fields.includes(irs_record_point.filter_field);

The custom edge validator is expecting the config to come with irs_record_point defined. Handling this feels like it will need a bunch of boilerplate - and has implications for other validators.

Nicolaidavies commented 6 years ago

@onlyjsmith I'm not sure I understand. But irs_record_point will be defined at the point in time the custom validator is run.

if irs_record_point is undefined, the custom validator won't run, as the edge doesn't exist and therefore fails.

onlyjsmith commented 5 years ago

Nope, it's really closed. Merged in https://github.com/locational/config-validation/pull/18.

onlyjsmith commented 5 years ago

@Nicolaidavies lib needs to be redeployed

Nicolaidavies commented 5 years ago

Lib has been redeployed as version 0.0.5