rspec-openapi 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7134b7b05a91d447b6a52af56ee417e6f0c045d73526f171d9792d2301d40db
4
- data.tar.gz: 8eeea5674f4e54c7ec53c1275f51b4dc47876438c64ee658db19cdbb6abc4489
3
+ metadata.gz: 3c2228341b1c207993fd9f98f74069e06a14fde9107d2fce34d4d6ae6d2c2184
4
+ data.tar.gz: 23b931010297c4618edac4ce3b51e0d78a9f052891c1c9384844742846988424
5
5
  SHA512:
6
- metadata.gz: 62b2b1e562954829ba607fa1f6713aa683fd508dde975198aa0c17c3dd7ad5db0e4d7e57aa80d6ca5a9d758a56d274128434eddc3f0dc9ac090117f80861bd7a
7
- data.tar.gz: 354bb226fa980dac17d7a67d66404aad653c5fc4dd26b985fbd335152063b67716d2573e699835c5bce10d929fad08ea28a5f4545186b5b6ce17dbf13ffe01f0
6
+ metadata.gz: fc620c878f8bc514b6f802c324984d16029632f819d2b92815f3a5c9122e93b982658c28ba1a6bf20b4c0021c0570d634a807f9d1e90cd6782f1dc0805aa3762
7
+ data.tar.gz: 2cbc49093a983dcd0c1efdf2a41785ec202b6cc582ba72a7fe2f2a4339dbfbcffcab56bf13d2899fa7e7ef067fd794362ae0ffecd1aa52980e8ecc56fa667142
@@ -1,3 +1,7 @@
1
+ ## v0.3.6
2
+
3
+ * Fix documents generated by Rails engines
4
+
1
5
  ## v0.3.5
2
6
 
3
7
  * Support finding routes in Rails engines
@@ -59,14 +59,17 @@ class << RSpec::OpenAPI::RecordBuilder = Object.new
59
59
  end
60
60
 
61
61
  # @param [ActionDispatch::Request] request
62
- def find_rails_route(request)
63
- # Reverse the destructive modification by Rails https://github.com/rails/rails/blob/v5.2.4.4/actionpack/lib/action_dispatch/journey/router.rb#L36-L44
64
- unless request.script_name.empty?
62
+ def find_rails_route(request, app: Rails.application, fix_path: true)
63
+ # Reverse the destructive modification by Rails https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/journey/router.rb#L33-L41
64
+ if fix_path && !request.script_name.empty?
65
65
  request = request.dup
66
66
  request.path_info = File.join(request.script_name, request.path_info)
67
67
  end
68
68
 
69
- Rails.application.routes.router.recognize(request) do |route|
69
+ app.routes.router.recognize(request) do |route|
70
+ unless route.path.anchored
71
+ route = find_rails_route(request, app: route.app.app, fix_path: false)
72
+ end
70
73
  return route
71
74
  end
72
75
  raise "No route matched for #{request.request_method} #{request.path_info}"
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.3.5'
3
+ VERSION = '0.3.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun