rawwar commented on code in PR #42973:
URL: https://github.com/apache/airflow/pull/42973#discussion_r1803498338
##########
airflow/api_fastapi/routes/public/dag_run.py:
##########
@@ -57,3 +57,19 @@ async def delete_dag_run(dag_id: str, dag_run_id: str,
session: Annotated[Sessio
)
session.delete(dag_run)
+
+
+@dag_run_router.patch("/{dag_run_id}",
responses=create_openapi_http_exception_doc([400, 401, 403, 404]))
Review Comment:
@pierrejeambrun , a bit confused about the HTTP verb here. From what I
read([Here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)) a
`PUT` is supposed to be for replacing entire content. a `PATCH` is supposed to
be for making a partial modification. So, Shouldn't this be a PATCH, rather
than a PUT since we are just modifying the state?
Also, According to
[Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT), a PUT
should be Idempotent. Hence, partial replacements will cause the resource not
to be identical(Especially if you consider a DAG object which has
`last_parsed_time` , which keeps changing).
Atleast from above, I feel like a PATCH should be having an update_mask,
while a PUT should be used to completely replace the object.
I apologise if I'm completely wrong. I've been reading about PUT vs PATCH as
I did not know the difference
--
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]