pierrejeambrun commented on code in PR #42929:
URL: https://github.com/apache/airflow/pull/42929#discussion_r1798942010
##########
airflow/api_fastapi/views/public/variables.py:
##########
@@ -56,3 +56,27 @@ async def get_variable(
raise HTTPException(404, f"The Variable with key: `{variable_key}` was
not found")
return VariableResponse.model_validate(variable, from_attributes=True)
+
+
+@variables_router.patch("/{variable_key}",
responses=create_openapi_http_exception_doc([400, 401, 403, 404]))
+async def patch_variable(
+ variable_key: str,
+ patch_body: VariableBody,
Review Comment:
Exactly. This is how things are usually done and are done also in the
Airflow legacy API.
This is why we have the exact check you are describing in the view
implementation here, inconsistent data between url and body are rejeected:
https://github.com/apache/airflow/pull/42929/files#diff-f33e731b8c0fedccbfd387d2fefa24f4148d99077292a4b37e7b9744372c7a9eR69
There's also a test for it.
--
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]