Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed errors in documentation for tag creation API #986

Merged
merged 1 commit into from Oct 5, 2012
Merged

Fixed errors in documentation for tag creation API #986

merged 1 commit into from Oct 5, 2012

Conversation

slavo
Copy link
Contributor

@slavo slavo commented Oct 5, 2012

Response format was wrong. Just tried this with the version on openphoto.me and the result is boolean, not a Tag object.

Response format was wrong.
@jmathai
Copy link
Member

jmathai commented Oct 5, 2012

@slavo thanks for pointing this out. I think this is a bug in the API and it should return the proper response per the documentation. I've opened issue #987 to track it. I believe the solution is in ApiTagController::create

-    return $this->created(sprintf('Tag %s created successfully.', $tag), true);
+    return $this->created(sprintf('Tag %s created successfully.', $tag), $res['result']);

@jmathai
Copy link
Member

jmathai commented Oct 5, 2012

Upon further investigation we can't return the Tag object because tags with a count of 0 (no photos with that tag) are essentially non-existant. That's why it's returning false. I've added a comment in the code and am merging this.

Thanks!

jmathai added a commit that referenced this pull request Oct 5, 2012
Fixed errors in documentation for tag creation API
#987
@jmathai jmathai merged commit 65c74d7 into photo:master Oct 5, 2012
@slavo
Copy link
Contributor Author

slavo commented Oct 8, 2012

Great. Now that I think of it, this would however be inconsistent with the APIs for creating other objects (photos). Is that OK?

If tags with a zero count are non-existent, is it then OK to make that count a requirement when creating them? I.e. not being able to create just a tag without any associated photos?

@jmathai
Copy link
Member

jmathai commented Oct 8, 2012

The photo upload API returns the photo object just created. All create endpoints should return the object created and a 201 response on success. If there are some which do not then definitely open an issue and we'll resolve it.

jmathai added a commit that referenced this pull request Mar 14, 2013
Fixed errors in documentation for tag creation API
#987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants