Merge pull request #17849 from woocommerce/fix/17818-1

Update REST API schema for backwards compatibility with WP 4.9
This commit is contained in:
Mike Jolley 2017-11-21 21:53:18 +00:00 committed by GitHub
commit 16152bfcf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 30 deletions

View File

@ -507,7 +507,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -354,7 +354,7 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V1_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -401,7 +401,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -422,12 +422,12 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
),
'name' => array(
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'product_id' => array(
'description' => __( 'Product ID.', 'woocommerce' ),
'type' => 'integer',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'variation_id' => array(
@ -513,7 +513,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -1119,7 +1119,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -1140,12 +1140,12 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'name' => array(
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'product_id' => array(
'description' => __( 'Product ID.', 'woocommerce' ),
'type' => 'integer',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'variation_id' => array(
@ -1231,7 +1231,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -1322,7 +1322,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -1346,12 +1346,12 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'method_title' => array(
'description' => __( 'Shipping method name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'method_id' => array(
'description' => __( 'Shipping method ID.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'total' => array(
@ -1408,7 +1408,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -1432,7 +1432,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'name' => array(
'description' => __( 'Fee name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'tax_class' => array(
@ -1506,7 +1506,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),
@ -1530,7 +1530,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'code' => array(
'description' => __( 'Coupon code.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'discount' => array(
@ -1564,7 +1564,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -945,7 +945,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -1991,7 +1991,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
),

View File

@ -378,7 +378,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
),
'name' => array(
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
@ -390,7 +390,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
),
'product_id' => array(
'description' => __( 'Product ID.', 'woocommerce' ),
'type' => 'integer',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'variation_id' => array(
@ -486,7 +486,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),

View File

@ -1211,7 +1211,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'name' => array(
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
@ -1223,7 +1223,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'product_id' => array(
'description' => __( 'Product ID.', 'woocommerce' ),
'type' => 'integer',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'variation_id' => array(
@ -1319,7 +1319,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'value' => array(
'description' => __( 'Meta value.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
@ -1397,12 +1397,12 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'method_title' => array(
'description' => __( 'Shipping method name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'method_id' => array(
'description' => __( 'Shipping method ID.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'total' => array(
@ -1457,7 +1457,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'name' => array(
'description' => __( 'Fee name.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'tax_class' => array(
@ -1528,7 +1528,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
),
'code' => array(
'description' => __( 'Coupon code.', 'woocommerce' ),
'type' => 'string',
'type' => 'mixed',
'context' => array( 'view', 'edit' ),
),
'discount' => array(