Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#41605 closed defect (bug) (wontfix)

REST API: Fixed schema for the Page post type is incorrect

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch has-unit-tests dev-feedback
Focuses: rest-api Cc:

Description

The fixed schema for the page post type incorrectly states that it supports the excerpt field. It does not.

Ref: https://github.com/WordPress/wordpress-develop/blob/d570de32ca3a5f623bf26d70dfc55141c339073d/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L1801-L1831

In addition, I'm not sure why the schemas for the Post, Page, and Attachment post types are hard-coded instead of relying on post type support.

Attachments (1)

41605.patch (3.2 KB) - added by johnbillion 7 years ago.

Download all attachments as: .zip

Change History (7)

@johnbillion
7 years ago

#1 @johnbillion
7 years ago

  • Keywords has-patch has-unit-tests dev-feedback added; needs-patch needs-unit-tests removed

#2 @johnbillion
7 years ago

Hmm, the attachment post type also states that it supports custom-fields, which it does not.

#3 @danielbachhuber
7 years ago

I'm not sure why the schemas for the Post, Page, and Attachment post types are hard-coded instead of relying on post type support.

The idea here was that core post types would always have a fixed schema:

I suspect the original conversation is in Slack somewhere...

#4 @johnbillion
7 years ago

Removing the excerpt field from the response when querying Pages could be considered a breaking change. What's the best path forward?

#5 @joehoyle
6 years ago

Woops, I guess we made them all adhere to an incorrect schema at the beginning. I don't know if there's much we can do about this now. Maybe make them read-only?

#6 @TimothyBlynJacobs
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree, I'm not sure there is much we can do here at this point without breaking BC. Particularly three years later. If someone wants to own it, feel free to reopen.

Note: See TracTickets for help on using tickets.