diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9283808f..dd6c2d41 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,39 +10,14 @@ jobs: strategy: fail-fast: false matrix: - include: - - ruby: '3.2' - rails: '7.2.2.2' - grape: '~> 1.8.0' - grape-swagger: '1.6.1' - - ruby: '3.2' - rails: '7.2.2.2' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' - - ruby: '3.3' - rails: '7.2.2.2' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' - - ruby: '3.4' - rails: '7.2.2.2' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' - - ruby: '3.2' - rails: '~> 8.1.3' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' - - ruby: '3.3' - rails: '~> 8.1.3' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' - - ruby: '3.4' - rails: '~> 8.1.3' - grape: '~> 3.1.0' - grape-swagger: '2.1.4' + ruby: ['3.2', '3.3', '3.4'] + rails: ['~> 8.1.4'] + json: ['~> 2.0', '~> 3.0'] env: - GRAPE_VERSION: ${{ matrix.grape }} - GRAPE_SWAGGER_VERSION: ${{ matrix.grape-swagger }} + GRAPE_VERSION: '~> 3.1.0' + GRAPE_SWAGGER_VERSION: '2.1.4' RAILS_VERSION: ${{ matrix.rails }} + JSON_VERSION: ${{ matrix.json }} steps: - uses: actions/checkout@v6 - name: Set up Ruby diff --git a/CHANGELOG.md b/CHANGELOG.md index 0888a63b..23b6f100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Next Release +* [#179](https://github.com/ruby-grape/grape-swagger-rails/pull/179): Require Rails 8.1.4+ and allow JSON 3 - [@moskvin](https://github.com/moskvin). * Your contribution here. ### 1.0.10 (2026/09/22) diff --git a/CLAUDE.md b/CLAUDE.md index b622ccbf..54a0429f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -73,8 +73,7 @@ Config in `.rubocop.yml` targets Ruby 3.4. Plugins: rubocop-capybara, rubocop-rs ## Compatibility Matrix -- Rails 7.2 / 8.1 × Ruby 3.2–3.4 × grape-swagger 2.1.4 (grape ~> 3.1) -- Rails 7.2 × Ruby 3.2 × grape-swagger 1.6.1 (grape ~> 1.8) — legacy combination +- Rails 8.1.4–8.1.x × Ruby 3.2–3.4 × JSON 2/3 × grape-swagger 2.1.4 (grape ~> 3.1) - Ruby 3.1 is excluded from Rails 8 (requires 3.2+) - grape ~> 1.8 is not tested on Ruby 3.4: Ruby 3.4 tightened `Forwardable` to raise on private-method delegation, which breaks Mustermann's `named_captures` forwarding used by grape-swagger 1.6.1 to introspect routes - Both Sprockets and Propshaft asset pipelines are tested in CI diff --git a/Gemfile b/Gemfile index 0b469b48..0a1604a5 100644 --- a/Gemfile +++ b/Gemfile @@ -18,13 +18,15 @@ else gem 'grape-swagger', grape_swagger_version end -case rails_version = ENV.fetch('RAILS_VERSION', '>= 7.2.3.1') +case rails_version = ENV.fetch('RAILS_VERSION', '>= 8.1.4') when 'edge' gem 'railties', github: 'rails/rails', branch: 'main' else gem 'railties', rails_version end +gem 'json', ENV.fetch('JSON_VERSION') if ENV.key?('JSON_VERSION') + group :development, :test do gem 'capybara' gem 'danger', require: false diff --git a/README.md b/README.md index 39ce2b44..95b84389 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,12 @@ Or install it yourself as: This gem is continuously tested against the following stack: -| Ruby | Rails | Grape | grape-swagger | Swagger UI | -|-----:|--------:|--------:|--------------:|-----------:| -| 3.4 | 7.2.2.2 | 1.8.x | 1.6.1 | 5.33.0 | -| 3.2+ | 7.2.2.2 | 3.1.x | 2.1.4 | 5.33.0 | -| 3.2+ | 8.1.x | 3.1.x | 2.1.4 | 5.33.0 | +| Ruby | Rails | JSON | Grape | grape-swagger | Swagger UI | +|-----:|-------:|--------:|------:|--------------:|-----------:| +| 3.2+ | 8.1.4–8.1.x | 2.x/3.x | 3.1.x | 2.1.4 | 5.33.0 | The dummy app and CI also exercise both supported Rails asset pipelines: Sprockets and Propshaft. +Rails 8.1.4 is required for JSON 3 compatibility; older Rails versions remain supported by the 1.x gem releases. If you use a nearby version and hit an issue, please open one with your `Gemfile.lock` and a minimal reproduction. diff --git a/grape-swagger-rails.gemspec b/grape-swagger-rails.gemspec index 6ebdb0e6..124fe40d 100644 --- a/grape-swagger-rails.gemspec +++ b/grape-swagger-rails.gemspec @@ -18,10 +18,9 @@ Gem::Specification.new do |spec| spec.require_paths = %w[lib] spec.required_ruby_version = '>= 3.2' spec.add_dependency 'haml-rails', '>= 2.0', '< 4.0' - # Supported Rails versions use JSON APIs removed in JSON 3 (quirks_mode and positional parse options). - spec.add_dependency 'json', '>= 2.0', '< 3.0' + spec.add_dependency 'json', '>= 2.0' spec.add_dependency 'ostruct', '>= 0.6', '< 1.0' - spec.add_dependency 'railties', '>= 7.2.2.2', '< 8.2' + spec.add_dependency 'railties', '>= 8.1.4', '< 8.2' spec.metadata = { 'bug_tracker_uri' => 'https://github.com/ruby-grape/grape-swagger-rails/issues', 'changelog_uri' => 'https://github.com/ruby-grape/grape-swagger-rails/blob/master/CHANGELOG.md',