Repository navigation
Conversation
Merge serializer options from actual namespace scopes, preserving outer-to-inner precedence, and forward root through render. Document adapter selection, root precedence, empty collections, root:false behavior, and unwrapped arrays. Cover each documented response shape with request-level regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply explicit namespace roots to single objects as well as collections. Preserve root precedence, inferred defaults, and adapter behavior, and document the breaking response-key change and migration options. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
breaking/3.0-consistent-roots
branch
from
October 27, 2026 02:46
af53bbe to
7d726f4
Compare
Danger ReportNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependency
Stacked on #107. Merge that compatibility fix first; this draft deliberately introduces the single-object behavior change separately for 3.0. The upstream PR targets master because the parent branch is in a fork. Focused diff against #107.
Breaking change
Bump the gem version to 3.0.0. An explicit namespace root now applies literally to both collections and single objects. With namespace users and root members, a collection remains {"members": [...]} and a single object changes from {"user": {...}} to {"members": {...}}. Roots are not automatically singularized.
Preserve render > route > inner namespace > outer namespace > default serializer option precedence. Without explicit roots, single objects retain model/serializer inference and collections retain namespace/route defaults. Adapter-specific behavior is unchanged, including attributes responses, JSON:API documents, and AMS root:false semantics.
Add a 3.0 changelog section, README examples, migration guidance, and focused request cases for inherited roots, inferred defaults, root:false, and attributes responses. To retain an old single-object key, set an explicit route/render root or move collection roots to collection routes.
Validation
All 88 examples and RuboCop pass locally on Ruby 4.0 with Grape 4. Hosted CI passes the full compatibility matrix and lint; Danger also passes.
Keep this PR as a draft for the next major release.
Created by Copilot, an AI, on behalf of @dblock.