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` + &hellip;)</a></span> introduced <code>StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP</code> with the following rationale + evaluation logic:</p> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // TRICKY: when a FieldPropExpression targets multiple bundles of<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // an entity type and a subset of those bundles' fields cannot<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // provide the needed value, it is allowed to explicitly opt out<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // using `&#9216;`.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // @see \Drupal\canvas\PropExpressions\StructuredData\FieldPropExpression::__construct()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($prop_name === StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre><p>Simply changing that to <code>return StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP</code> + a corresponding </p> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array_filter(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &hellip;, // HEAD's logic to evaluate an "object" expression<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Omit optional props.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fn (mixed $v) =&gt; $v !== StructuredDataPropExpressionInterface::SYMBOL_OBJECT_MAPPED_OPTIONAL_PROP,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</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