-
Notifications
You must be signed in to change notification settings - Fork 651
WIP for Additional Fields in responses #927
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually do anything with this result. If it's a WP_Error, we should return it upwards and break the loop immediately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to contradict your comment below:
I'm fine with us treating each field as atomic by itself though, rather than the whole set of fields as atomic (i.e. one failure doesn't break immediately).
I think the fields should be treat in insolation, if a given field fails to update, we shouldn't discriminate against other addition fields by other plugins etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbachhuber this was using posts before for the "title", however all our other endpoints use singular names. I presumed this title refers to the object name, not plural form, so i changed this to just the post type. Do you see issues with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine for now. We'll eventually need to revisit these schemas to dot our i's and cross our t's
On May 4, 2015, at 16:53, Joe Hoyle notifications@github.com wrote:
In lib/endpoints/class-wp-rest-posts-controller.php:
@@ -1150,7 +1156,7 @@ public function get_item_schema() {
$base = $this->get_post_type_base( $this->post_type );
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => $base, @danielbachhuber this was using posts before for the "title", however all our other endpoints use singular names. I presumed this title refers to the object name, not plural form, so i changed this to just the post type. Do you see issues with that?'title' => $this->post_type,—
Reply to this email directly or view it on GitHub.
Introduce `register_api_field()` to add response fields to an object and it's schema.
|
Merged #927 |
No description provided.