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
This commit is contained in:
parent
20f2edbb4e
commit
18d9cc6051
|
@ -1141,7 +1141,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'comment',
|
'title' => 'comment',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -240,7 +240,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'status',
|
'title' => 'status',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -201,7 +201,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'type',
|
'title' => 'type',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -1685,7 +1685,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
|
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => $this->post_type,
|
'title' => $this->post_type,
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
// Base properties for every Post.
|
// Base properties for every Post.
|
||||||
|
|
|
@ -452,7 +452,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => "{$this->parent_post_type}-revision",
|
'title' => "{$this->parent_post_type}-revision",
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
// Base properties for every Revision.
|
// Base properties for every Revision.
|
||||||
|
|
|
@ -274,7 +274,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||||
$options = $this->get_registered_options();
|
$options = $this->get_registered_options();
|
||||||
|
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'settings',
|
'title' => 'settings',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(),
|
'properties' => array(),
|
||||||
|
|
|
@ -228,7 +228,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'taxonomy',
|
'title' => 'taxonomy',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -804,7 +804,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy,
|
'title' => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy,
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -1129,7 +1129,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
public function get_item_schema() {
|
public function get_item_schema() {
|
||||||
$schema = array(
|
$schema = array(
|
||||||
'$schema' => 'http://json-schema.org/schema#',
|
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||||
'title' => 'user',
|
'title' => 'user',
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'properties' => array(
|
'properties' => array(
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue