-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add documentation about wildcard includes #1201
Conversation
render @posts, include: params[:include] | ||
``` | ||
|
||
This raises some security concerns since the user could pass in `include=**`, so filter the values for `include` appropriately if you decide to support this JSON API feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 whitelist ftw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to mention this.
@hut8 Thanks for the PR, we really need this. Please see my comments. |
@beauby Better? |
render @posts, include: '**' # or '*' for a single layer | ||
``` | ||
|
||
The following would render posts and include every resource referenced by the posts' authors' comments (recursively). It could be combined, like above, with other paths in any combination desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
include the author, the author's comments, and every resource referenced by the authors' comments (recursively)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than this. Sorry for being a bit a bit tedious on this PR but I can foresee many issues caused by people misunderstanding this functionality.
@beauby Not tedious at all! It's important to make these things clear and this is a pretty awesome gem. I'm glad to be able to help. |
render @posts, include: '**' # or '*' for a single layer | ||
``` | ||
|
||
The following would render posts and include the author, the author's comments, and every resource by the author's comments (recursively). It could be combined, like above, with other paths in any combination desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a missing word here:
and every ??? resource by the author's comments (recursively)
See my last remark, then let's squash and merge! |
Seemas though I accidentally a word. Fixed. Squashed and pushed. |
LGTM, merging. Thanks a lot @hut8! |
Add documentation about wildcard includes
Resolves #1200