23241a6749 opened a new pull request, #77486:
URL: https://github.com/apache/airflow/pull/77486

   Closes #51428.
   
   The Trigger Dag form currently requires JSON when entering an object 
parameter. This adds a format selector so users can paste a YAML mapping, 
including the nested example in the issue. JSON stays selected by default. Both 
formats submit the same object in the Dag run configuration.
   
   Invalid YAML stays in the editor with an inline error. Editing another 
parameter keeps Trigger disabled until the error is corrected. The selector is 
scoped to the Trigger Dag form.
   
   ### Testing
   
   - The 15 relevant UI test files passed locally (141 tests). The form test 
covers the JSON default, nested mappings, malformed input, a top-level 
sequence, non-finite numbers, and switching back to JSON.
   - The production UI build, TypeScript, ESLint, oxlint and formatting checks 
passed locally.
   - In Chrome against a local Airflow API, entering `a: [` disabled Trigger. 
After correcting it to a nested mapping, the trigger request returned HTTP 200. 
Fetching the created Dag run returned `{"settings":{"a":{"b":"c"}}}` in its 
configuration.
   
   ### Screenshots
   
   | Before | After, JSON selected by default |
   | --- | --- |
   | ![Original JSON-only object 
editor](https://raw.githubusercontent.com/23241a6749/airflow/3144f7e6db637eff0aaf22c8783e2d784aff3b5c/00-before-json.png)
 | ![Trigger Dag with the JSON format 
selected](https://raw.githubusercontent.com/23241a6749/airflow/3144f7e6db637eff0aaf22c8783e2d784aff3b5c/01-default-json.png)
 |
   
   | Valid nested YAML | Invalid YAML with Trigger disabled |
   | --- | --- |
   | ![YAML mapping ready to 
submit](https://raw.githubusercontent.com/23241a6749/airflow/3144f7e6db637eff0aaf22c8783e2d784aff3b5c/02-nested-yaml.png)
 | ![Malformed YAML with an inline error and disabled Trigger 
button](https://raw.githubusercontent.com/23241a6749/airflow/3144f7e6db637eff0aaf22c8783e2d784aff3b5c/03-invalid-yaml.png)
 |
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — OpenAI Codex (GPT-6)
   
   Generated-by: OpenAI Codex (GPT-6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to