Skip to content

Commit

Permalink
[REST API] Updated Settings schema since now we allow batch update
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Sep 11, 2018
1 parent 1411567 commit 0ab5dc3
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions includes/api/class-wc-rest-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,47 @@ public function update_item( $request ) {

return $response;
}

/**
* Get the groups schema, conforming to JSON Schema.
*
* @since 3.0.0
* @return array
*/
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'setting_group',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'A unique identifier that can be used to link settings together.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'label' => array(
'description' => __( 'A human readable label for the setting used in interfaces.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'description' => array(
'description' => __( 'A human readable description for the setting used in interfaces.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'parent_id' => array(
'description' => __( 'ID of parent grouping.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'sub_groups' => array(
'description' => __( 'IDs for settings sub groups.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
),
);

return $this->add_additional_fields_schema( $schema );
}
}

0 comments on commit 0ab5dc3

Please sign in to comment.