apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
35.76k stars 13.91k forks source link

'external_trigger' in OpenAPI specs has a default value which as a result, will be always included in the request body by the generated OpenAPI specs #22365

Open omarsmak opened 2 years ago

omarsmak commented 2 years ago

Apache Airflow version

2.2.4 (latest released)

What happened

We have this in the DAGRun model:

      external_trigger:
          type: boolean
          default: true
          readOnly: true

We use the same model for both getting the dagrun details and trigging dagrun. However, since we include a default value, the generated OpenAPI client will include the default value nevertheless during POST /dags/{dag_id}/dagRuns which as a result the request will be failed in the validation process on Airflow side since this is a read only property and was set nevertheless by the default value. For honesty, I am not sure if this shall be an Airflow bug or an OpenAPI generator bug (I think readOnly should be respected during and it should ignore the default value) but in the other hand, I don't really understand why has to be a default value for read only external_trigger 🤔 . Removing the default value shall fix this issue.

What you think should happen instead

No response

How to reproduce

No response

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

If you guys think this can be fixed on Airflow side, I will be happy to provide a PR .

Are you willing to submit PR?

Code of Conduct

potiuk commented 2 years ago

Feel free to fix it.

eladkal commented 1 year ago

@omarsmak are you still working on this issue?

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.