uranusjr commented on issue #18714: URL: https://github.com/apache/airflow/issues/18714#issuecomment-935177145
REST API is only a guide line without hard rules, but `PATCH` generally means the user can submit a subset of fields, and the missing fields would be filled by existing values on the model. It is a natural variant to PUT, which _replaces_ all fields on the model with new values specified in the request. https://datatracker.ietf.org/doc/html/rfc5789#section-2 > The difference between the PUT and PATCH requests is reflected in the way the server processes the enclosed entity to modify the resource identified by the Request-URI. In a PUT request, the enclosed entity is considered to be a modified version of the resource stored on the origin server, and the client is requesting that the stored version be replaced. With PATCH, however, the enclosed entity contains a set of instructions describing how a resource currently residing on the origin server should be modified to produce a new version. The PATCH method affects the resource identified by the Request-URI, and it also MAY have side effects on other resources; i.e., new resources may be created, or existing ones modified, by the application of a PATCH. Now it is entirely undefined whether sending a list in PATCH should mean merging the lists in the request and the existing object, or replacing the entire list on the existing object with the one in the request. But the merging behaviour does not really make common sense since it would make deleting entries impossible. So I'm inclined to think the current behaviour is wrong. -- 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]
