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

Representing a list of orders #71

Open
jchannon opened this issue Jun 19, 2016 · 4 comments
Open

Representing a list of orders #71

jchannon opened this issue Jun 19, 2016 · 4 comments

Comments

@jchannon
Copy link

If I go to /orders typically I would expect that to return a list of orders however the spec says the properties item should be a key value pair object so to get around that if I then decide to include each order as sub entities the spec says the rel should identify the sub entity's relation to the parent but in this situation there is no parent.

What is the best practice to return a list of resources?

@pmhsfelix
Copy link

Can't we use the "entities" field to include the items representations, using the "item" link relation?

@kevinswiber
Copy link
Owner

Yes. Per Pedro's advice, this is usually how I represent list items.

On Wed, Jun 22, 2016 at 12:02 PM Pedro Felix [email protected]
wrote:

Can't we use the "entities" field to include the items representations,
using the "item" link relation?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAEy9jg6eVkCTP6lM3TdsRGSJT5A0fLqks5qOYbfgaJpZM4I5JSw
.

@jchannon
Copy link
Author

Do you keep properties null or add an object with a count property?

On 22 June 2016 at 20:09, Kevin Swiber [email protected] wrote:

Yes. Per Pedro's advice, this is usually how I represent list items.

On Wed, Jun 22, 2016 at 12:02 PM Pedro Felix [email protected]
wrote:

Can't we use the "entities" field to include the items representations,
using the "item" link relation?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71 (comment),
or mute the thread
<
https://github.com/notifications/unsubscribe/AAEy9jg6eVkCTP6lM3TdsRGSJT5A0fLqks5qOYbfgaJpZM4I5JSw

.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#71 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGapryu8E7ZZGyXWQV7Mrd3E5FKE09-ks5qOYhzgaJpZM4I5JSw
.

@kevinswiber
Copy link
Owner

Sometimes I toss in a count, as it can be handy for clients, but it depends
on the use case. The properties object is optional, and I prefer
excluding it altogether instead of setting it to null.

On Wed, Jun 22, 2016 at 12:13 PM Jonathan Channon [email protected]
wrote:

Do you keep properties null or add an object with a count property?

On 22 June 2016 at 20:09, Kevin Swiber [email protected] wrote:

Yes. Per Pedro's advice, this is usually how I represent list items.

On Wed, Jun 22, 2016 at 12:02 PM Pedro Felix [email protected]
wrote:

Can't we use the "entities" field to include the items representations,
using the "item" link relation?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#71 (comment)
,
or mute the thread
<

https://github.com/notifications/unsubscribe/AAEy9jg6eVkCTP6lM3TdsRGSJT5A0fLqks5qOYbfgaJpZM4I5JSw

.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#71 (comment),
or mute the thread
<
https://github.com/notifications/unsubscribe/AAGapryu8E7ZZGyXWQV7Mrd3E5FKE09-ks5qOYhzgaJpZM4I5JSw

.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#71 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAEy9h_t6uh0fwpepdZfwH6P3nMz-wvHks5qOYlSgaJpZM4I5JSw
.

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

No branches or pull requests

3 participants