title: Magento 2: How to Implement Validation in UI-Component with parameters
body: <p>Ok. Everyone's got an answer on how to add validation rules to a ui-component field via XML. Unfortunately, I can't find anyone that seems to know how to implement a rule that requires a parameter or two. I'm sure the knowledge is out there, but nobody's asked the question. So here it is.</p>
  <p>I'm looking to implement the <code>min-words</code> validation rule for a textarea. I've got something like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;field name=&quot;text_area&quot;&gt;
      &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;
          &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;
              ...
              &lt;item name=&quot;validation&quot; xsi:type=&quot;array&quot;&gt;
                  &lt;item name=&quot;required-entry&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;/item&gt;
                  &lt;item name=&quot;min-words&quot; xsi:type=&quot;array&quot;&gt;
                      &lt;item name=&quot;length&quot; xsi:type=&quot;number&quot;&gt;10&lt;/item&gt;
                  &lt;/item&gt;
              &lt;/item&gt;
              ...
          &lt;/item&gt;
      &lt;/argument&gt;
  &lt;/field&gt;
  </code></pre>
  <p>but I'm guessing, and this doesn't quite work. I'm close, but can't figure out what the &quot;length&quot; parameter is really supposed to be, and looking at the <code>rules.js</code> file doesn't provide any clues.</p>