Skip to content

Stop populating the write-only namespace description in desc#2787

Open
ericproulx wants to merge 1 commit into
masterfrom
drop_namespace_description
Open

Stop populating the write-only namespace description in desc#2787
ericproulx wants to merge 1 commit into
masterfrom
drop_namespace_description

Conversation

@ericproulx

Copy link
Copy Markdown
Contributor

desc wrote its settings into two places — the route scope (route_setting(:description)) and the namespace scope (namespace_setting(:description)) — but the namespace copy was pure dead state:

  • Grape's runtime reads only route[:description] (in route(), and only for the :params key).
  • The namespace scope isn't wired for inheritance — InheritableSetting#inherit_from sets inherited_values for namespace_inheritable/namespace_stackable/namespace_reverse_stackable and merges route, but never touches @namespace. So namespace-scope values are only cloned by point_in_time_copy and never consulted.
  • grape-swagger doesn't read it either (checked against the local checkout).

Confirmed by experiment: dropping the write breaks only the desc_spec.rb assertions that checked the write itself — the rest of the suite is unaffected.

Change

desc now writes only the route scope. namespace_setting(:description) returns nil; a route's description remains available via route_setting(:description) and the route.description reader. UPGRADING note added.

Full suite green (2351 examples, 0 failures); RuboCop clean.

🤖 Generated with Claude Code

@ericproulx ericproulx force-pushed the drop_namespace_description branch from 22c44e2 to 3532917 Compare July 6, 2026 12:35
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@ericproulx ericproulx requested a review from dblock July 6, 2026 12:40
`desc` stored its settings under both the route scope
(`route_setting(:description)`) and the namespace scope
(`namespace_setting(:description)`). The namespace copy was never read:
`route` consumes only `route[:description]`, the namespace scope is not
wired for inheritance (`InheritableSetting#inherit_from` skips `@namespace`),
and grape-swagger reads neither. `desc` now writes only the route scope.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ericproulx ericproulx force-pushed the drop_namespace_description branch from 3532917 to 9b6eeae Compare July 6, 2026 12:44
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.

1 participant