zachliu opened a new issue #14635:
URL: https://github.com/apache/airflow/issues/14635
**Apache Airflow version**: 2.0.1
**Environment**: Docker on Linux Mint 20.1, image based on
apache/airflow:2.0.1-python3.8
**What happened**:
when i made this PATCH request to the API:
```python
>>> import json
>>> import requests
>>> from requests.auth import HTTPBasicAuth
>>> payload = {"dag_id": "example_bash_operator", "is_paused": False}
>>> r =
requests.patch('https://localhost:8080/api/v1/dags/example_bash_operator?update_mask=["is_paused"]',
auth=HTTPBasicAuth('username', 'password'), data=json.dumps(payload),
headers={'Content-Type': 'application/json'})
```
the following error occurred
```
HTTP response body: {
"detail": "Property is read-only - 'dag_id'",
"status": 400,
"title": "Bad Request",
"type":
"https://airflow.apache.org/docs/2.0.1/stable-rest-api-ref.html#section/Errors/BadRequest"
}
```
**What do you think went wrong?**:
The `requestBody` of the `patch` request is defined to use the `DAG` schema:
https://github.com/apache/airflow/blob/33910d6c699b5528db4be40d31199626dafed912/airflow/api_connexion/openapi/v1.yaml#L423-L428
But the `dag_id` property in the `DAG` schema has been defined as
`readOnly`:
https://github.com/apache/airflow/blob/33910d6c699b5528db4be40d31199626dafed912/airflow/api_connexion/openapi/v1.yaml#L1452-L1455
And according to https://github.com/zalando/connexion/issues/942, we'll get
a 400 error
**Anything else we need to know**:
This is not exactly an issue on Airflow's side. Unless someone thinks we
should remove `UpdateMask` from the specs.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]