File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 55* Adding hidden endpoints - [ @arturoherrero ] ( https://github.com/arturoherrero ) .
66* Fix: allow urls with ` - ` - [ @dadario ] ( https://github.com/dadario ) .
77* Fix: mounting multiple documentations - [ @Drakula2k ] ( https://github.com/Drakula2k ) .
8+ * Fix: resource groupings for prefixed APIs - [ @aew ] ( https://github.com/aew ) .
89* Your Contribution Here
910
1011### 0.6.0 (June 19, 2013)
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def add_swagger_documentation(options={})
1313
1414 @combined_routes = { }
1515 routes . each do |route |
16- resource = route . route_path . match ( '\/([\w|-]*?)[\.\/\(]' ) . captures . first
16+ resource = route . route_path . split ( route . route_prefix ) . last . match ( '\/([\w|-]*?)[\.\/\(]' ) . captures . first
1717 next if resource . empty?
1818 resource . downcase!
1919 @combined_routes [ resource ] ||= [ ]
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ def app; SimpleApiWithMarkdown end
257257 end
258258 end
259259
260- context "versioned API" do
260+ context "prefixed and versioned API" do
261261 before :all do
262262 class VersionedMountedApi < Grape ::API
263263 prefix 'api'
@@ -278,7 +278,8 @@ class SimpleApiWithVersion < Grape::API
278278 def app ; SimpleApiWithVersion end
279279
280280 it "parses version and places it in the path" do
281- get '/swagger_doc/api.json'
281+ get '/swagger_doc/something.json'
282+
282283 JSON . parse ( last_response . body ) [ "apis" ] . each do |api |
283284 api [ "path" ] . should start_with "/api/v1/"
284285 end
You can’t perform that action at this time.
0 commit comments