AiDataTypeConverters incorrectly handling multi value Contexts
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3541562. --> Reported by: [michaellander](https://www.drupal.org/user/636494) Related to !833 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><code>ContextDefinitions</code> that support multiple values are evaluated as a whole instead of as individual items in an array. This can create odd behavior as the original value itself may need converting to an array before trying to validate individual items. Such would be the case if AI were to pass a csv string of IDs "1,2,3,4" as an argument to a multi value <code>entity_reference</code> field.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>For multi value context definitions, pass the value to the converter first with a data type of <code>map?</code>(confirm), then loop through the resulting array and convert the individual parameters against the <code>ContextDefinition data_type</code>. Create a new converter for handling arrays they may be passed as csv strings, json?, yaml?, etc. The json and yaml converters might already work here, so may not be necessary.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3>
issue