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

Update examples to use single objects instead of arrays #239

Conversation

whatthewhat
Copy link

This replaces arrays with a single object as defined in #237

I'm not sure, but on the front page it might look better to leave the array and add a second post..

@@ -380,13 +380,13 @@ Here's another example:
"links": {
"posts.comments": "http://example.com/comments/{posts.comments}"
},
"posts": [{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this instance should be changed. My understanding of the spec is that a single resource such as /posts/1 could be represented as a single object, where as a collection of resources /posts should be represented as a collection, even if there is only one item in the collection. That said, I could be misreading the spec - it doesn't seem to clarify whether a "singular resource" is when a single resource is returned, or when a single resource is requested.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BRMatt you are definitely right here

What got me confused is that on the front page it's not obvious what is being fetched, a resource or a collection

@whatthewhat whatthewhat closed this Jul 7, 2014
@dgeb
Copy link
Member

dgeb commented Jul 7, 2014

@BRMatt @whatthewhat I just created #240 which attempts to clarify the singular / plural issue with different wording. Please let me know if this change works for you.

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

3 participants