Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#51940 closed defect (bug) (fixed)

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

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

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 (8)

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


6 years ago
#1

  • Keywords has-patch added; needs-patch removed

#2 @johnbillion
6 years ago

  • Milestone Awaiting Review → 5.7

#3 @TimothyBlynJacobs
6 years ago

  • Owner set to TimothyBlynJacobs
  • Resolution → fixed
  • Status new → 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
6 years ago

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

Do you think we should backport this?

#6 @johnbillion
6 years ago

  • Keywords fixed-major added
  • Milestone 5.7 → 5.6.1
  • Resolution fixed
  • Status closed → reopened

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

This ticket was mentioned in ​Slack in #core by whyisjake. ​View the logs.


6 years ago

#8 @whyisjake
6 years ago

  • Resolution → fixed
  • Status reopened → closed

In 50047:

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

Previously, all taxonomies were incorrectly exposed as possible values.

This commit brings the changes from [49922] to the 5.6 branch.

Props johnbillion, TimothyBlynJacobs.

Fixes #51940.

Note: See TracTickets for help on using tickets.