Skip to content

Document JSON:API included resources - #108

Open
dblock wants to merge 1 commit into
ruby-grape:masterfrom
dblock:docs/jsonapi-included-88
Open

dblock wants to merge 1 commit into
ruby-grape:masterfrom
dblock:docs/jsonapi-included-88

Conversation

@dblock

@dblock dblock commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Changes

  • Show how to declare relationship serializers and request related attributes with the JSON:API adapter and an explicit author include. Provide an example compound document distinguishing relationship linkage from top-level included resources.
  • Explain identifiers, nested include paths, route/default options, and why database eager loading or an include query parameter alone does not request AMS included resources. No runtime behavior or dependency changes.
  • Add four real-request cases covering linkage without inclusion, explicit included attributes, deduplication across a primary collection, and route-level adapter/include options.

Validation

All 79 examples and RuboCop pass locally on Ruby 4.0/Grape 4. The documented behavior uses existing supported AMS options.

Hosted CI passes all 15 Ruby/Grape jobs and lint. Danger also passes.

Closes #88.

Created by Copilot, an AI, on behalf of @dblock.

@dblock
dblock force-pushed the docs/jsonapi-included-88 branch from 03d46d6 to 1f96390 Compare October 26, 2026 13:21
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Danger Report

Messages

  • We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests!

View run

@samsonjs samsonjs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Another feature I don't use but since it's only docs + specs seems safe to merge

@dblock

dblock commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

rebasing this ...

@samsonjs same, feel free to close without merging, it was vibe-coded based on the ask in #88

Show declared relationships and include options with the JSON API adapter, distinguish resource linkage from included attributes, and explain eager loading versus serialization. Verify explicit inclusion, shared-resource deduplication, and route-level configuration with actual requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the docs/jsonapi-included-88 branch from 8b93a02 to a95e19a Compare October 27, 2026 02:28
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.

How can I have a resource loaded in included (jsonapi format) ?

2 participants