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 5
5
* Adding hidden endpoints - [ @arturoherrero ] ( https://github.com/arturoherrero ) .
6
6
* Fix: allow urls with ` - ` - [ @dadario ] ( https://github.com/dadario ) .
7
7
* Fix: mounting multiple documentations - [ @Drakula2k ] ( https://github.com/Drakula2k ) .
8
+ * Fix: resource groupings for prefixed APIs - [ @aew ] ( https://github.com/aew ) .
8
9
* Your Contribution Here
9
10
10
11
### 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={})
13
13
14
14
@combined_routes = { }
15
15
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
17
17
next if resource . empty?
18
18
resource . downcase!
19
19
@combined_routes [ resource ] ||= [ ]
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ def app; SimpleApiWithMarkdown end
257
257
end
258
258
end
259
259
260
- context "versioned API" do
260
+ context "prefixed and versioned API" do
261
261
before :all do
262
262
class VersionedMountedApi < Grape ::API
263
263
prefix 'api'
@@ -278,7 +278,8 @@ class SimpleApiWithVersion < Grape::API
278
278
def app ; SimpleApiWithVersion end
279
279
280
280
it "parses version and places it in the path" do
281
- get '/swagger_doc/api.json'
281
+ get '/swagger_doc/something.json'
282
+
282
283
JSON . parse ( last_response . body ) [ "apis" ] . each do |api |
283
284
api [ "path" ] . should start_with "/api/v1/"
284
285
end
You can’t perform that action at this time.
0 commit comments