`GeneratedFieldExplicitInputUxComponentSourceBase::validateComponentInput()` allows garbage to pile up
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3524401. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !424 !1039
>>>
<h3 id="overview">Overview</h3>
<p>Unlike for the <code>block</code> component source plugin (see <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3524399" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3524399</a></span>), no garbage values are AFAICT allowed for the <code>sdc</code> and <code>js</code> component sources.</p>
<p>This is thanks to <code>GeneratedFieldExplicitInputUxComponentSourceBase::validateComponentInput()</code> calling</p>
<pre>$this->componentValidator->validateProps($resolvedInputValues, $this->getSdcPlugin());</pre><p>
which would complain about unused props.</p>
<p><del>… or so I think 😅</del> Nope: see @akhil babu's research in <a href="https://www.drupal.org#comment-16109893">#5</a>.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p><del>Add test coverage to prove that the SDC + JS component sources are unaffected.</del> → disproven by @akhil babu in <a href="https://www.drupal.org#comment-16109893">#5</a>.</p>
<ol>
<li>Test coverage: a new <code>GeneratedFieldExplicitInputUxComponentSourceBase::testValidateComponentInput()</code>, that tests garbage values being set for the <code>sdc.xb_test_sdc.props-slots</code>SDC.</li>
<li>Fix <code>GeneratedFieldExplicitInputUxComponentSourceBase::validateComponentInput()</code>.</li>
</ol>
<h3 id="ui-changes">User interface changes</h3>
<p>None.</p>
issue