Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Conversation

@joehoyle
Copy link
Member

No description provided.

@rachelbaker rachelbaker modified the milestones: 2.0 Beta 1, 2.0 Beta 2 Apr 27, 2015
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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?

Copy link
Member

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,
    
  •       'title'      => $this->post_type,
    
    @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?


Reply to this email directly or view it on GitHub.

rachelbaker added a commit that referenced this pull request May 5, 2015
Introduce `register_api_field()` to add response fields to an object and it's schema.
@rachelbaker rachelbaker merged commit 9c11b0c into develop May 5, 2015
@rachelbaker rachelbaker deleted the api-fields branch May 5, 2015 02:35
@rachelbaker
Copy link
Member

Merged #927

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants