Add Field Widget Actions (FWA) support for JSON field types using the json_textarea widget
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3566581. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !1099
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>Add Field Widget Actions (FWA) support for JSON field types using the json_textarea widget.<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>JSON fields are frequently used to store structured configuration and machine-readable data that AI Automators can generate, validate, or transform. Today, JSON field types do not provide an in-widget way to trigger AI Automators when using the <code>json_textarea</code> widget.<br>
This issue proposes adding Field Widget Actions (FWA) support for the JSON field types <code>json</code>, <code>json_native</code>, and <code>json_native_binary</code> when rendered with the <code>json_textarea</code> widget, using <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code> as reference implementation. The implementation requires the JSON Field module (<code>json_field</code>) to be enabled, as it provides the field types and widget.<br>
A simple way to test this is to configure an AI Automator that generates valid JSON from a text description (or normalizes existing JSON) and stores the result into the JSON field via the FWA.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a single new FWA plugin that supports the <code>json</code>, <code>json_native</code>, and <code>json_native_binary</code> field types when using the <code>json_textarea</code> widget, modeled after <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code>.</li>
<li>Declare a dependency on the JSON Field module and ensure the FWA is only available when one of the supported JSON field types and the <code>json_textarea</code> widget are in use.</li>
</ul>
<p>- <strong>This issue was created with the help of AI</strong></p>
issue