fix(ruby): pin link-header-parser to >=7.0 and fix its new keyword arg - #1229
Merged
Conversation
link-header-parser 7.0 renamed the base: keyword to base_uri: and changed group_by_relation_type to return string keys instead of symbols, crashing any paginated response with an ArgumentError. Update response.rb to use the new API and constrain the gemspec dependency accordingly. Fixes phrase/phrase-ruby#11 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
API changelog (oasdiff)Doc-only edits (descriptions, examples) do not appear here. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the generated Ruby client to remain compatible with link-header-parser 7.x (pagination Link header parsing) and adds a regression spec to prevent future breakage.
Changes:
- Constrain the Ruby client gemspec template to require
link-header-parser >= 7.0. - Update
Phrase::Responseto use the newbase_uri:keyword when parsingLinkheaders and to handle the new return shape. - Add an RSpec regression test for paginated and non-paginated responses, and unignore it in
.gitignore.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openapi-generator/templates/ruby-client/gemspec.mustache | Adds a runtime dependency constraint for link-header-parser to ensure the generated client installs a compatible major version. |
| clients/ruby/lib/phrase/response.rb | Updates pagination link parsing for link-header-parser 7.x API changes. |
| clients/ruby/spec/response_spec.rb | Adds regression coverage for Phrase::Response pagination behavior. |
| .gitignore | Keeps the new Ruby response spec checked in despite the broader ignore rule for generated Ruby specs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… types Since the gemspec now requires link-header-parser >= 7.0, which always returns string keys from group_by_relation_type, there's no need to convert remote-derived relation-type strings into symbols. Addresses Copilot review feedback on #1229. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Mikko Karkee (Varpuspaavi)
approved these changes
Aug 3, 2026
This was referenced Aug 3, 2026
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
link-header-parser7.0 renamed thebase:keyword argument tobase_uri:and changedgroup_by_relation_typeto return string keys instead of symbols. Since the ruby client's gemspec had no version constraint, anyone installing/updating today gets 7.0.1, and any paginated API response crashes withArgumentError: missing keyword: :base_uriinPhrase::Response#initialize.clients/ruby/lib/phrase/response.rbto callLinkHeaderParser.parsewithbase_uri:and normalizegroup_by_relation_type's keys back to symbols.link-header-parserruntime dependency to>= 7.0inopenapi-generator/templates/ruby-client/gemspec.mustache(the template that generatesclients/ruby/phrase.gemspec).clients/ruby/spec/response_spec.rb, a regression spec coveringPhrase::Responsewith and without paginationLinkheaders — there was previously no test coverage for this file at all, which is why the existing suite passed despite the crash. Added a.gitignoreexception for it, following the same pattern used for the existing hand-maintainedlocales_api_spec.rb/uploads_api_spec.rb.Fixes phrase/phrase-ruby#11
Test plan
bundle exec rspec spec/response_spec.rb— new spec passes with the fix, and reproduces the reportedArgumentErrorwhen the fix is revertedbundle exec rspec— full suite (1845 examples) passes🤖 Generated with Claude Code