Skip to content

Added example for "Sparse Fieldsets" #667

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

Closed
wants to merge 1 commit into from

Conversation

ksimka
Copy link
Contributor

@ksimka ksimka commented May 22, 2015

Example demonstrating how fields param works.

Example demonstrating how `fields` param works.
@dgeb
Copy link
Member

dgeb commented May 22, 2015

Thanks for this, @ksimka!

We may ask you to retarget this to a new top-level examples page we're planning in #503.

@tkellen
Copy link
Member

tkellen commented May 27, 2015

@ksimka We've just added the page @dgeb mentioned--would you mind refactoring?

@ksimka
Copy link
Contributor Author

ksimka commented May 27, 2015

Yes, but I'm not sure that I understand #670 correctly. The response in the example depends on it. Could you please clarify if we've already resolved the confusion between include and fields?

@tkellen
Copy link
Member

tkellen commented May 27, 2015

@dgeb is about to submit a PR that puts this issue to bed. Let's revisit after?

@ksimka
Copy link
Contributor Author

ksimka commented May 27, 2015

Let's revisit after?

Ok, I'll refactor right after #670 is closed.

@tkellen
Copy link
Member

tkellen commented May 27, 2015

Just closed via #688.

@ksimka
Copy link
Contributor Author

ksimka commented May 27, 2015

Sorry, I feel stupid, but still not sure if I get it right )

If include=a.b.c&fields[A]=d,e where a consists of A, bB and cC, so A will not have linkage to objects B (that will be in included), and we can't link them properly. Or does that mean to not include b at all? Then C objects can't be linked to anything, they're useless. Or should server in this case provide straight linkage from a to c? Or am I missing something obviuos again?)

```

Request with `fields` parameter:

```http
GET /articles?include=author&fields[articles]=title,body&fields[people]=name
Copy link
Member

Choose a reason for hiding this comment

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

Relationships must also be included in fields, even if they're specified via include. Therefore, the author field would have to be included in fields[articles] to get the response below.

In other words, the request would need to be:

GET /articles?include=author&fields[articles]=title,body,author&fields[people]=name

@ksimka
Copy link
Contributor Author

ksimka commented May 27, 2015

Thanks, @dgeb. Closing in favour of #691.

@ksimka ksimka closed this May 27, 2015
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy