From c91b1b7e68e2641e8190c7b6fa32754a4b2eb530 Mon Sep 17 00:00:00 2001 From: Andreas Haller Date: Tue, 19 Aug 2025 21:24:53 +0200 Subject: [PATCH 1/2] 2.11.1 - OpenapiFirst can now route requests correctly for paths like `/stuffs` and `/stuffs{format}` (https://github.com/ahx/openapi_first/issues/386) --- CHANGELOG.md | 4 ++ Gemfile.lock | 116 +++++++++++++++++------------------ benchmarks/Gemfile.lock | 10 +-- lib/openapi_first/version.rb | 2 +- 4 files changed, 68 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfd21a2c..7b60757a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 2.11.1 + +- OpenapiFirst can now route requests correctly for paths like `/stuffs` and `/stuffs{format}` (https://github.com/ahx/openapi_first/issues/386) + ## 2.11.0 - OpenapiFirst::Test.observe now works with `Rack::URLMap` (returned by `Rack::Builder.app`) and probably all objects that respond to `.call` diff --git a/Gemfile.lock b/Gemfile.lock index fce0c0c6..800372f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - openapi_first (2.11.0) + openapi_first (2.11.1) hana (~> 1.3) json_schemer (>= 2.1, < 3.0) openapi_parameters (>= 0.6.1, < 2.0) @@ -10,29 +10,29 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (8.0.2) - actionpack (= 8.0.2) - activesupport (= 8.0.2) + actioncable (8.0.2.1) + actionpack (= 8.0.2.1) + activesupport (= 8.0.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.2) - actionpack (= 8.0.2) - activejob (= 8.0.2) - activerecord (= 8.0.2) - activestorage (= 8.0.2) - activesupport (= 8.0.2) + actionmailbox (8.0.2.1) + actionpack (= 8.0.2.1) + activejob (= 8.0.2.1) + activerecord (= 8.0.2.1) + activestorage (= 8.0.2.1) + activesupport (= 8.0.2.1) mail (>= 2.8.0) - actionmailer (8.0.2) - actionpack (= 8.0.2) - actionview (= 8.0.2) - activejob (= 8.0.2) - activesupport (= 8.0.2) + actionmailer (8.0.2.1) + actionpack (= 8.0.2.1) + actionview (= 8.0.2.1) + activejob (= 8.0.2.1) + activesupport (= 8.0.2.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.2) - actionview (= 8.0.2) - activesupport (= 8.0.2) + actionpack (8.0.2.1) + actionview (= 8.0.2.1) + activesupport (= 8.0.2.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -40,35 +40,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.2) - actionpack (= 8.0.2) - activerecord (= 8.0.2) - activestorage (= 8.0.2) - activesupport (= 8.0.2) + actiontext (8.0.2.1) + actionpack (= 8.0.2.1) + activerecord (= 8.0.2.1) + activestorage (= 8.0.2.1) + activesupport (= 8.0.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.2) - activesupport (= 8.0.2) + actionview (8.0.2.1) + activesupport (= 8.0.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.2) - activesupport (= 8.0.2) + activejob (8.0.2.1) + activesupport (= 8.0.2.1) globalid (>= 0.3.6) - activemodel (8.0.2) - activesupport (= 8.0.2) - activerecord (8.0.2) - activemodel (= 8.0.2) - activesupport (= 8.0.2) + activemodel (8.0.2.1) + activesupport (= 8.0.2.1) + activerecord (8.0.2.1) + activemodel (= 8.0.2.1) + activesupport (= 8.0.2.1) timeout (>= 0.4.0) - activestorage (8.0.2) - actionpack (= 8.0.2) - activejob (= 8.0.2) - activerecord (= 8.0.2) - activesupport (= 8.0.2) + activestorage (8.0.2.1) + actionpack (= 8.0.2.1) + activejob (= 8.0.2.1) + activerecord (= 8.0.2.1) + activesupport (= 8.0.2.1) marcel (~> 1.0) - activesupport (8.0.2) + activesupport (8.0.2.1) base64 benchmark (>= 0.3) bigdecimal @@ -179,20 +179,20 @@ GEM rack (>= 1.3) rackup (2.2.1) rack (>= 3) - rails (8.0.2) - actioncable (= 8.0.2) - actionmailbox (= 8.0.2) - actionmailer (= 8.0.2) - actionpack (= 8.0.2) - actiontext (= 8.0.2) - actionview (= 8.0.2) - activejob (= 8.0.2) - activemodel (= 8.0.2) - activerecord (= 8.0.2) - activestorage (= 8.0.2) - activesupport (= 8.0.2) + rails (8.0.2.1) + actioncable (= 8.0.2.1) + actionmailbox (= 8.0.2.1) + actionmailer (= 8.0.2.1) + actionpack (= 8.0.2.1) + actiontext (= 8.0.2.1) + actionview (= 8.0.2.1) + activejob (= 8.0.2.1) + activemodel (= 8.0.2.1) + activerecord (= 8.0.2.1) + activestorage (= 8.0.2.1) + activesupport (= 8.0.2.1) bundler (>= 1.15.0) - railties (= 8.0.2) + railties (= 8.0.2.1) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -200,9 +200,9 @@ GEM rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (8.0.2) - actionpack (= 8.0.2) - activesupport (= 8.0.2) + railties (8.0.2.1) + actionpack (= 8.0.2.1) + activesupport (= 8.0.2.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -213,7 +213,7 @@ GEM rdoc (6.14.2) erb psych (>= 4.0.0) - regexp_parser (2.11.0) + regexp_parser (2.11.2) reline (0.6.2) io-console (~> 0.5) rspec (3.13.1) @@ -228,8 +228,8 @@ GEM rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.4) - rubocop (1.79.1) + rspec-support (3.13.5) + rubocop (1.79.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -270,7 +270,7 @@ GEM timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) + unicode-display_width (3.1.5) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.3) diff --git a/benchmarks/Gemfile.lock b/benchmarks/Gemfile.lock index 1da3ae63..56162439 100644 --- a/benchmarks/Gemfile.lock +++ b/benchmarks/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - openapi_first (2.11.0) + openapi_first (2.11.1) hana (~> 1.3) json_schemer (>= 2.1, < 3.0) openapi_parameters (>= 0.6.1, < 2.0) @@ -16,10 +16,10 @@ GEM benchmark-memory (0.2.0) memory_profiler (~> 1) bigdecimal (3.2.2) - committee (5.5.4) + committee (5.5.5) json_schema (~> 0.14, >= 0.14.3) openapi_parser (~> 2.0) - rack (>= 1.5, < 3.2) + rack (>= 1.5) hana (1.3.7) json_schema (0.21.0) json_schemer (2.4.0) @@ -41,7 +41,7 @@ GEM webrick puma (6.6.1) nio4r (~> 2.0) - rack (3.1.16) + rack (3.2.0) rack-protection (4.1.1) base64 (>= 0.1.0) logger (>= 1.6.0) @@ -49,7 +49,7 @@ GEM rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) - regexp_parser (2.11.0) + regexp_parser (2.11.2) ruby2_keywords (0.0.5) simpleidn (0.2.3) sinatra (4.1.1) diff --git a/lib/openapi_first/version.rb b/lib/openapi_first/version.rb index c27b2ec2..0db7d113 100644 --- a/lib/openapi_first/version.rb +++ b/lib/openapi_first/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OpenapiFirst - VERSION = '2.11.0' + VERSION = '2.11.1' end From 1d13b2d24c8873d436e8ea677bf1c109c0294729 Mon Sep 17 00:00:00 2001 From: Andreas Haller Date: Tue, 19 Aug 2025 21:40:08 +0200 Subject: [PATCH 2/2] Format code --- lib/openapi_first/configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openapi_first/configuration.rb b/lib/openapi_first/configuration.rb index f2b1b4ae..832ebe9e 100644 --- a/lib/openapi_first/configuration.rb +++ b/lib/openapi_first/configuration.rb @@ -14,7 +14,7 @@ def initialize @request_validation_error_response = OpenapiFirst.find_error_response(:default) @request_validation_raise_error = false @response_validation_raise_error = true - @hooks = (HOOKS.map { [_1, Set.new] }).to_h + @hooks = HOOKS.to_h { [_1, Set.new] } @path = nil end