Follow-up for #3530533: `::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP` should be omitted rather than evaluate to NULL.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3545623. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !48
>>>
<h3 id="overview">Overview</h3>
<p><em>Blocks <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/acquia_dam/issues/3519247" title="Status: Closed (fixed)">#3519247: Acquia DAM and Canvas integration</a></span>.</em></p>
<p>See <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/acquia_dam/issues/3519247" title="Status: Closed (fixed)">#3519247: Acquia DAM and Canvas integration</a></span> for a detailed write-up.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3530533" title="Status: Closed (fixed)">#3530533: Support image shape matching against multiple bundles of multiple MediaSources (`image` + `oembed` + `acquia_dam_asset` + …)</a></span> introduced <code>StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP</code> with the following rationale + evaluation logic:</p>
<pre> // TRICKY: when a FieldPropExpression targets multiple bundles of<br> // an entity type and a subset of those bundles' fields cannot<br> // provide the needed value, it is allowed to explicitly opt out<br> // using `␀`.<br> // @see \Drupal\canvas\PropExpressions\StructuredData\FieldPropExpression::__construct()<br> if ($prop_name === StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP) {<br> return NULL;<br> }</pre><p>Simply changing that to <code>return StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP</code> + a corresponding </p>
<pre> array_filter(<br> …, // HEAD's logic to evaluate an "object" expression<br> // Omit optional props.<br> fn (mixed $v) => $v !== StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP,<br> }</pre><p>is sufficient to correctly comply with JSON Schema now that Canvas uses <code>justinrainbow/json-schema:6.x</code></p>
<h3 id="ui-changes">User interface changes</h3>
<p>None.</p>
> Related issue: [Issue #3530533](https://www.drupal.org/node/3530533)
> Related issue: [Issue #3519247](https://www.drupal.org/node/3519247)
> Related issue: [Issue #3540470](https://www.drupal.org/node/3540470)
issue