[wp-trac] [WordPress Trac] #35822: Add support for PATCH method to REST API infrastructure

WordPress Trac noreply at wordpress.org
Fri Feb 12 22:02:32 UTC 2016


#35822: Add support for PATCH method to REST API infrastructure
--------------------------+-----------------------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The REST API infrastructure in Core presently does not support a JSON
 format for the body of `PATCH` requests. Supporting `PATCH` requests is a
 dependency for implementing Customizer transactions (#30937), where there
 will be a `customize_transaction` post type which contains a JSON blog of
 the dirty settings representing the Customizer state. Each change to a
 setting should result in a `PATCH` request to push the newly-dirty setting
 value into the dirty settings already in the `customize_transaction` post,
 as opposed to having to re-post the entire array of dirty settings with
 each request.

 I understand that `PATCH` requests in the wild today commonly just include
 the sparse values that should be applied to the existing resource, but
 that the proper way to implement `PATCH` is to require that an explicit
 diff data format be used in the request body, such as a list of add,
 change, remove operations with a JSON path/pointer to apply to a resource
 ([http://tools.ietf.org/html/rfc6902 RFC 6902]). Should JSON Patch
 (`application/json-patch+json`) be required for `PATCH` requests or should
 an informal sparse JSON object (`application/json`) be acceptable?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35822>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list