WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 9 days ago

#51940 reopened defect (bug)

The schema for the taxonomy property of a term in the REST API should not include all taxonomies

Reported by: johnbillion Owned by: TimothyBlynJacobs
Milestone: 5.6.1 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch fixed-major
Focuses: Cc:

Description

When performing an OPTIONS request to a term endpoint of the REST API, for example /wp-json/wp/v2/tags or /wp-json/wp/v2/categories, the $.schema.properties.taxonomy.enum property in the schema contains a list of names of all taxonomies on the site (and to boot, not just those that are exposed via the REST API).

This is incorrect. The enum should contain only one value containing the name of the taxonomy associated with the route.

Change History (6)

This ticket was mentioned in PR #789 on WordPress/wordpress-develop by johnbillion.


6 weeks ago

  • Keywords has-patch added; needs-patch removed

#2 @johnbillion
6 weeks ago

  • Milestone changed from Awaiting Review to 5.7

#3 @TimothyBlynJacobs
2 weeks ago

  • Owner set to TimothyBlynJacobs
  • Resolution set to fixed
  • Status changed from new to closed

In 49922:

REST API: Only include the controller's own taxonomy in it's schema.

Previously, all taxonomies were incorrectly exposed as possible values.

Props johnbillion.
Fixes #51940.

#4 @TimothyBlynJacobs
2 weeks ago

(and to boot, not just those that are exposed via the REST API)

Do you think we should backport this?

#6 @johnbillion
9 days ago

  • Keywords fixed-major added
  • Milestone changed from 5.7 to 5.6.1
  • Resolution fixed deleted
  • Status changed from closed to reopened

Yes this is a good candidate for backporting to 4.7.x.

Note: See TracTickets for help on using tickets.