# Aurelia 2 - Validator

**URL:** <https://discourse.aurelia.io/t/aurelia-2-validator/3479>\
**Category:** vNext\
**Created:** [May 11, 2020, 3:11pm UTC](https://discourse.aurelia.io/t/aurelia-2-validator/3479 "2020-05-11T15:11:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![airboss001](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/airboss001/32/719_2.png) [@airboss001](https://discourse.aurelia.io/u/airboss001)\
**Post date:** [May 11, 2020, 3:11pm UTC](https://discourse.aurelia.io/t/aurelia-2-validator/3479/1 "2020-05-11T15:11:54Z")

</div>

I just went through the new validator and documentation.  
Holey cow! That new format is awesome!

I am a hack, I admit it. I don’t spend all my time doing frontend code and am always having to go back and relearn some code usage or another. All the examples is absolutely going to make my relearning curve so much faster!

I cannot give enough kudos to the team and the direction docs seem to be moving.

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [May 13, 2020, 11:19am UTC](https://discourse.aurelia.io/t/aurelia-2-validator/3479/2 "2020-05-13T11:19:27Z")

</div>

Will the `ValidationRules.ensure(...).rules` (saving a “rules” object) approach still be supported? It does not seem to be present in the documentation at [https://docs.aurelia.io/app-basics/validating-data](https://docs.aurelia.io/app-basics/validating-data).

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [May 13, 2020, 11:44am UTC](https://discourse.aurelia.io/t/aurelia-2-validator/3479/3 "2020-05-13T11:44:43Z")

</div>

The API still supports exporting rules, but is slightly different form in contrast to Aurelia1.

IMO the rule export helps for selective validation. In that context, the support for tagged rules has been improved a lot. You can use the tags to selectively execute the rules for object and/or properties. IMO it is more ergonomic, and easier to work with than to deal with the rules.

Check the docs for rule tagging: [https://docs.aurelia.io/app-basics/validating-data#tagging-rules](https://docs.aurelia.io/app-basics/validating-data#tagging-rules)  
Also the corresponding demo: [https://stackblitz.com/edit/au2-validation-tagging-rules](https://stackblitz.com/edit/au2-validation-tagging-rules)

In case the tagged rules don’t serve your use-case, can you please elaborate your use-case?

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [May 13, 2020, 12:40pm UTC](https://discourse.aurelia.io/t/aurelia-2-validator/3479/4 "2020-05-13T12:40:06Z")

</div>

I am aware of tagged rules and I did notice they seem to have improved in usability; we will reconsider our use case when the time will come.
