Skip to content

Commit

Permalink
Merge pull request #986 from datacite/revert-962-openapi-schema
Browse files Browse the repository at this point in the history
Revert "Openapi-schema"
  • Loading branch information
digitaldogsbody authored Jul 19, 2023
2 parents 19f842e + 9adc224 commit 38c5b53
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
24 changes: 0 additions & 24 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "open-uri"

class ApplicationController < ActionController::API
include ActionController::HttpAuthentication::Basic::ControllerMethods
include Authenticable
Expand Down Expand Up @@ -166,28 +164,6 @@ def skip_bullet
Bullet.enable = previous_value
end

def serve_manifest
url = ENV["PLUGIN_MANIFEST_URL"] || "https://api.datacite.org"
data = URI.open(url).read

send_data(
data,
type: "application/json",
disposition: "inline"
)
end

def serve_openapi_spec
url = ENV["PLUGIN_OPENAPI_URL"] || "https://api.datacite.org"
data = URI.open(url).read

send_data(
data,
type: "text/yaml",
disposition: "inline"
)
end

protected
def is_admin_or_staff?
current_user&.is_admin_or_staff? ? 1 : 0
Expand Down
5 changes: 0 additions & 5 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
# send reset link
post "reset", to: "sessions#reset"

## to route when requesting .well-known/ai-plugin.json to route to that file
get "/.well-known/ai-plugin.json", to: "application#serve_manifest"
get "/graphql-openapi.yaml", to: "application#serve_openapi_spec"

# content negotiation via index path
get "/application/vnd.datacite.datacite+xml/:id",
to: "index#show",
Expand Down Expand Up @@ -248,7 +244,6 @@
constraints: { id: /.+/ },
format: false


root to: "index#index"

# rescue routing errors
Expand Down

0 comments on commit 38c5b53

Please sign in to comment.