Skip to content

Commit

Permalink
[REST API] Fixed schema for product's downloads
Browse files Browse the repository at this point in the history
Download ID are generated with wp_generate_uuid4() for while now.
Also we allow users to manipulate it.
  • Loading branch information
claudiosanches committed Oct 16, 2018
1 parent df55670 commit 63390c1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions includes/api/class-wc-rest-product-variations-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down
3 changes: 1 addition & 2 deletions includes/api/class-wc-rest-products-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down
6 changes: 2 additions & 4 deletions includes/api/v1/class-wc-rest-products-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1882,10 +1882,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down Expand Up @@ -2360,10 +2359,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down
3 changes: 1 addition & 2 deletions includes/api/v2/class-wc-rest-products-v2-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1606,10 +1606,9 @@ public function get_item_schema() {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'File MD5 hash.', 'woocommerce' ),
'description' => __( 'File ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'File name.', 'woocommerce' ),
Expand Down

0 comments on commit 63390c1

Please sign in to comment.