[wp-trac] [WordPress Trac] #61739: REST API: Implement 'targetHints' property
WordPress Trac
noreply at wordpress.org
Tue Sep 17 21:50:54 UTC 2024
#61739: REST API: Implement 'targetHints' property
--------------------------------------+--------------------------------
Reporter: Mamaduka | Owner: TimothyBlynJacobs
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.7
Component: REST API | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):
* owner: (none) => TimothyBlynJacobs
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"59032" 59032]:
{{{
#!CommitTicketReference repository="" revision="59032"
REST API: Automatically populate targetHints for the Allow header.
The REST API uses the "Allow" header to communicate what methods a user is
authorized to perform on a resource. This works great when operating on a
single item route, but can break down when needing to determine
authorization over a collection of items.
This commit uses the "targetHints" property of JSON Hyper Schema to
provide access to the "allow" header for "self" links. This alleviates
needing to make a separate network request for each item in a collection.
Props mamaduka, noisysocks, peterwilsoncc, spacedmonkey, swissspidy,
timothyblynjacobs, tyxla, youknowriad.
Fixes #61739.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61739#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list