[wp-trac] [WordPress Trac] #53417: The revisions endpoints provide an incorrect JSON schema

WordPress Trac noreply at wordpress.org
Tue Jun 15 23:20:51 UTC 2021


#53417: The revisions endpoints provide an incorrect JSON schema
--------------------------+-----------------------------
 Reporter:  johnbillion   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Revisions     |    Version:  4.7
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:  rest-api      |
--------------------------+-----------------------------
 The schema provided by the REST API endpoints for revisions at
 `wp/v2/posts/{id}/revisions` and `wp/v2/pages/{id}/revisions` is
 incorrect. The schema states that a `content.protected` property exists
 for each revision, but this property does not exist.

 * [https://github.com/WordPress/wordpress-
 develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes
 /rest-api/endpoints/class-wp-rest-revisions-controller.php#L736 The schema
 is constructed here] from the parent controller for posts, which does
 include this property
 * [https://github.com/WordPress/wordpress-
 develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes
 /rest-api/endpoints/class-wp-rest-revisions-controller.php#L600-L604 When
 the data is prepared here] the `protected` property is not included

 Two options:

 1. Remove the `content.protected` property from the schema
 2. Add the `content.protected` property to the response

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


More information about the wp-trac mailing list