maylisdvoodoo opened a new issue, #41439:
URL: https://github.com/apache/airflow/issues/41439

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.6.3
   
   ### What happened?
   
   In the Trigger DAG end point, using the DAG conf Parameters form will 
incorrectly convert a array of object to an array of string when the parameter 
type is defined as:
   
   ```
   "jobs_list": Param(
               [ {"name": "account_name", "country": "country_name"} ],
               type="array",
               items={
                   "type": "object",
                   "properties": {"name": {"type": "string"}, "country_name": 
{"type": "string"}},
               },
   )
   ```
   
   This can be seen by comparing the value in the field to what is produced in 
the generated JSON config : 
   <img width="805" alt="Capture d’écran 2024-08-13 à 18 51 21" 
src="https://github.com/user-attachments/assets/d399af9e-1542-47e5-955d-0c0656358039";>
   
   If this JSON configuration is submitted, then the validation will raise an 
error because `"{"name": "account_name", "country": "country_name"}"` is not a 
valid object but a string 
   
   ### What you think should happen instead?
   
   When a parameter is defined as an array of objects, the DAG Conf Parameters 
form should generate a value in the Generated JSON config that is an array of 
objects.
   
   ```
   Param(
                 [ {"name": "account_name", "country": "country_name"} ],
                 type="array",
                 items={
                   "type": "object",
                   "properties": {"name": {"type": "string"}, "country_name": 
{"type": "string"}},
                  },
               ),
   ```
   It should be:
   
   ```
    [ {"name": "account_name", "country": "country_name"} ]
   ```
   
   instead of
   `[ "{"name": "account_name", "country": "country_name"} "]`
   
   ### How to reproduce
   
   1. Create a DAG that has a parameter with previous definition of array of 
objects : I took it from Airflow Official [Dag 
Example](https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/example_dags/example_params_ui_tutorial.html)
   
   2. Navigate to the Trigger DAG Run for that DAG
   3. Add an object in the DAG Conf Parameters form
   4. Note the value in the Generated JSON config has quotes
   5. Press submit, and see an error message like:
   
   ### Operating System
   
   Amazon Linux AMI
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Amazon (AWS) MWAA
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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