From 18d9cc6051514a1171acc279a3caa4f726e14e29 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Wed, 4 Oct 2017 14:52:46 +0000 Subject: [PATCH] REST API: Specify specific json-schema version. Explicitly specifies that the REST API uses JSON Schema draft-04, as JSON Schema has deprecated versionless schema URIs and recommends the use of a specific draft version. Props @TimothyBlynJacobs Fixes #41734 Built from https://develop.svn.wordpress.org/trunk@41731 git-svn-id: http://core.svn.wordpress.org/trunk@41565 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-comments-controller.php | 2 +- .../endpoints/class-wp-rest-post-statuses-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-post-types-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-revisions-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-settings-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-taxonomies-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-terms-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-users-controller.php | 2 +- wp-includes/version.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 415ba8e9bc..4eced8f8ae 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -1141,7 +1141,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'comment', 'type' => 'object', 'properties' => array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php index 369cf3c757..e2cce55b65 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php @@ -240,7 +240,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'status', 'type' => 'object', 'properties' => array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php index c4571d9721..d574ba8372 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php @@ -201,7 +201,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'type', 'type' => 'object', 'properties' => array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 80027cfea8..8d65252537 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1685,7 +1685,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', // Base properties for every Post. diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php index a648fa2de5..298fcc5748 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php @@ -452,7 +452,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => "{$this->parent_post_type}-revision", 'type' => 'object', // Base properties for every Revision. diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php index 17a01b8ba6..1618e3597c 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php @@ -274,7 +274,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller { $options = $this->get_registered_options(); $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'settings', 'type' => 'object', 'properties' => array(), diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php index ea97135677..9720a20945 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php @@ -228,7 +228,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'taxonomy', 'type' => 'object', 'properties' => array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php index ca0f53263a..7c145e198c 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php @@ -804,7 +804,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy, 'type' => 'object', 'properties' => array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index 372c9654de..44d6367a54 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -1129,7 +1129,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { */ public function get_item_schema() { $schema = array( - '$schema' => 'http://json-schema.org/schema#', + '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'user', 'type' => 'object', 'properties' => array( diff --git a/wp-includes/version.php b/wp-includes/version.php index 49666be8d1..0f6a55c375 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41730'; +$wp_version = '4.9-alpha-41731'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.