Skip to content

Conversation

@opencode-agent
Copy link
Contributor

I have fixed the ArgumentError that occurred when running the generator with Ruby 3.0.0. This error was caused by Ruby 3's strict separation of positional and keyword arguments.

I updated the t and tt helper methods in the SwaggerGenerator to use keyword argument splatting (**options), ensuring they correctly pass options to I18n.t in a way that is compatible with Ruby 3.0.0 and later.

Changes:

  • Modified lib/generators/jsonapi/swagger/swagger_generator.rb:
    • Updated t(key, **options) and tt(key, **options) to use keyword arguments.
    • Updated the call to I18n.t(key, **options) to use the double splat operator.

This change maintains compatibility with older Ruby versions while resolving the issue on Ruby 3.0.0.

Closes #12

New%20session%20-%202026-01-25T08%3A55%3A40.398Z
opencode session  |  github run

Co-authored-by: superiorlu <superiorlu@users.noreply.github.com>
@superiorlu superiorlu merged commit 12e48ad into master Jan 25, 2026
1 check failed
@superiorlu superiorlu deleted the opencode/issue12-20260125085540 branch January 25, 2026 09:03
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.

/usr/local/bundle/gems/i18n-1.8.9/lib/i18n.rb:196:in `translate': wrong number of arguments (given 2, expected 0..1) (ArgumentError)

1 participant