Deprecate positional options Hash for desc; add grape-swagger integration spec#2723
Open
ericproulx wants to merge 1 commit into
Open
Deprecate positional options Hash for desc; add grape-swagger integration spec#2723ericproulx wants to merge 1 commit into
desc; add grape-swagger integration spec#2723ericproulx wants to merge 1 commit into
Conversation
…tion spec `Grape::DSL::Desc#desc` now takes its options as keyword arguments. Passing a positional options Hash still works but emits a deprecation warning, so downstream callers (e.g. grape-swagger) keep functioning. Adds a grape-swagger integration spec plus a CI matrix entry and `gemfiles/grape_swagger.gemfile`. The spec exercises `add_swagger_documentation` and asserts the generated OpenAPI document, guarding the compatibility shim: grape-swagger 2.1.4 still passes a positional Hash to `desc` internally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8cf355c to
13aef99
Compare
Contributor
Author
|
Upstream grape-swagger issue for the internal positional-Hash |
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.
Summary
Grape::DSL::Desc#descnow accepts its options as keyword arguments. Passing a positional options Hash still works but emits a deprecation warning viaGrape.deprecator, so downstream callers keep functioning through the deprecation cycle.grape-swagger integration coverage
Adds
spec/integration/grape_swagger/grape_swagger_spec.rb, agemfiles/grape_swagger.gemfile, and a dedicated CI matrix entry (mirroring the existinggrape_entity/dry_validationintegration jobs).The spec stands up a real API with
add_swagger_documentationand asserts the generated OpenAPI 2.0 document (paths, descriptions carried fromdesc,success:responses, declared params, per-resource/swagger_doc/:name).It also documents why the shim matters: grape-swagger 2.1.4 still calls
desc 'text', options_hashinternally (lib/grape-swagger/doc_methods.rb), so without the compatibility path the latest grape-swagger would break outright under the keyword-only signature. An upstream issue has been opened onruby-grape/grape-swaggerto migrate to keyword arguments.Tests
gemfiles/grape_swagger.gemfilespec/grape/dsl/desc_spec.rb: covers the keyword form and the deprecated positional form (warns + still works when silenced)desc-exercising specs pass under the default gemfile🤖 Generated with Claude Code