Skip to content

Commit 05b2579

Browse files
authored
Remove unmaintained apipie-rails (#4555)
1 parent 4b514f4 commit 05b2579

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

config/routes.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
draw :pushes
1515
draw :pwp_api
1616

17-
apipie
18-
get "/help/api", to: "pages#api", as: :help_api
19-
2017
get "/pages/*id" => "pages#show", :as => :page, :format => false
2118

2219
mount Mailbin::Engine => :mailbin if Rails.env.development?

config/routes/pwp_api.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
constraints(format: :json) do
2-
namespace :api do
3-
namespace :v2 do
2+
namespace :api, defaults: {format: :json} do
3+
namespace :v2, defaults: {format: :json} do
44
get :version, to: "version#show"
55

66
resources :pushes, except: %i[new index edit update] do
@@ -12,8 +12,8 @@
1212
end
1313
end
1414

15-
namespace :api do
16-
namespace :v1 do
15+
namespace :api, defaults: {format: :json} do
16+
namespace :v1, defaults: {format: :json} do
1717
get :version, to: "version#show"
1818
end
1919
end
@@ -50,3 +50,13 @@
5050
end
5151
end
5252
end
53+
54+
# APIv2 Documentation
55+
constraints(format: :html) do
56+
get "/help/api", to: "pages#api", as: :help_api
57+
end
58+
59+
# Legacy APIv1 Documentation - redirect to https://docs.pwpush.com/docs/api-v1/
60+
constraints(format: :html) do
61+
get "/api", to: redirect("https://docs.pwpush.com/docs/api-v1/"), as: :help_api_v1
62+
end

test/integration/api/api_v2_pushes_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def test_help_api_page_is_available
1717
assert_response :success
1818
end
1919

20-
def test_existing_apipie_docs_remain_available
20+
def test_legacy_api_v1_docs_are_redirected
2121
get "/api"
22-
assert_response :success
22+
assert_response :redirect
2323
end
2424

2525
def test_versioned_requests_and_accounts_endpoints_are_not_exposed

0 commit comments

Comments
 (0)