From 913905001ed9cb0d3d112da2ab472966191d9486 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Mon, 22 Feb 2016 17:53:00 +0100 Subject: [PATCH] Revert swagger docs --- Gemfile | 3 - Gemfile.lock | 44 -------- app/controllers/api/v1/dossiers_controller.rb | 20 ---- .../api/v1/procedures_controller.rb | 13 +-- config/initializers/grape_swagger_rails.rb | 3 - config/initializers/swagger-docs.rb | 21 ---- config/routes.rb | 2 - public/api-docs.json | 20 ---- public/api/v1/dossiers.json | 102 ------------------ public/api/v1/procedures.json | 52 --------- 10 files changed, 1 insertion(+), 279 deletions(-) delete mode 100644 config/initializers/grape_swagger_rails.rb delete mode 100644 config/initializers/swagger-docs.rb delete mode 100644 public/api-docs.json delete mode 100644 public/api/v1/dossiers.json delete mode 100644 public/api/v1/procedures.json diff --git a/Gemfile b/Gemfile index 0612d7aca..708cf04ce 100644 --- a/Gemfile +++ b/Gemfile @@ -77,9 +77,6 @@ gem "smart_listing" gem 'css_splitter' gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8' -gem 'swagger-docs' -gem 'grape-swagger-rails' - gem 'as_csv' group :test do diff --git a/Gemfile.lock b/Gemfile.lock index d2119251c..5dc12198f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,10 +59,6 @@ GEM autoprefixer-rails (5.2.1) execjs json - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) bcrypt (3.1.10) bindata (2.1.0) binding_of_caller (0.7.2) @@ -93,8 +89,6 @@ GEM ffi (~> 1.0, >= 1.0.11) cliver (0.3.2) coderay (1.1.0) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -109,8 +103,6 @@ GEM sprockets (>= 2.0.0) database_cleaner (1.4.1) debug_inspector (0.0.2) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) devise (3.4.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -130,7 +122,6 @@ GEM em-websocket (0.5.1) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) - equalizer (0.0.11) erubis (2.7.0) eventmachine (1.0.8) execjs (2.5.2) @@ -144,25 +135,6 @@ GEM formatador (0.2.5) globalid (0.3.5) activesupport (>= 4.1.0) - grape (0.14.0) - activesupport - builder - hashie (>= 2.1.0) - multi_json (>= 1.3.2) - multi_xml (>= 0.5.2) - rack (>= 1.3.0) - rack-accept - rack-mount - virtus (>= 1.0.0) - grape-entity (0.4.8) - activesupport - multi_json (>= 1.3.2) - grape-swagger (0.10.4) - grape (>= 0.8.0) - grape-entity (< 0.5.0) - grape-swagger-rails (0.1.0) - grape-swagger (>= 0.7.2) - railties (>= 3.2.12) guard (2.13.0) formatador (>= 0.2.4) listen (>= 2.7, <= 4.0) @@ -200,7 +172,6 @@ GEM http_parser.rb (0.6.0) httpclient (2.6.0.1) i18n (0.7.0) - ice_nine (0.11.2) jbuilder (2.3.1) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) @@ -245,7 +216,6 @@ GEM mini_portile (0.6.2) minitest (5.7.0) multi_json (1.11.2) - multi_xml (0.5.5) multipart-post (2.0.0) nenv (0.2.0) netrc (0.10.3) @@ -289,10 +259,6 @@ GEM byebug (~> 5.0) pry (~> 0.10) rack (1.6.4) - rack-accept (0.4.5) - rack (>= 0.4) - rack-mount (0.8.3) - rack (>= 1.0.0) rack-oauth2 (1.2.1) activesupport (>= 2.3) attr_required (>= 0.0.5) @@ -422,9 +388,6 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - swagger-docs (0.2.8) - activesupport (>= 3, < 5) - rails (>= 3, < 5) swd (1.0.0) activesupport (>= 3) attr_required (>= 0.0.5) @@ -461,11 +424,6 @@ GEM validate_url (1.0.2) activemodel (>= 3.0.0) addressable - virtus (1.0.5) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) warden (1.2.3) rack (>= 1.0) web-console (2.2.1) @@ -510,7 +468,6 @@ DEPENDENCIES draper factory_girl font-awesome-rails - grape-swagger-rails guard guard-livereload (~> 2.4) guard-rspec @@ -547,7 +504,6 @@ DEPENDENCIES smart_listing spring spring-commands-rspec - swagger-docs terminal-notifier terminal-notifier-guard therubyracer diff --git a/app/controllers/api/v1/dossiers_controller.rb b/app/controllers/api/v1/dossiers_controller.rb index 3c6c432fb..6234b6046 100644 --- a/app/controllers/api/v1/dossiers_controller.rb +++ b/app/controllers/api/v1/dossiers_controller.rb @@ -1,24 +1,4 @@ class API::V1::DossiersController < APIController - swagger_controller :dossiers, "Dossiers" - - swagger_api :index do - summary "Récupérer la liste de ses dossiers." - param :path, :procedure_id, :integer, "Procédure ID" - param :query, :token, :integer, "Admin TOKEN" - response :ok, "Success", :Dossier - response :unauthorized - response :not_found - end - - swagger_api :show do - summary "Récupérer le détails d'un dossier." - param :path, :procedure_id, :integer, "Procédure ID" - param :path, :id, :integer, "Dossier ID" - param :query, :token, :integer, "Admin TOKEN" - response :ok, "Success", :Dossier - response :unauthorized - response :not_found - end def index procedure = current_administrateur.procedures.find(params[:procedure_id]) diff --git a/app/controllers/api/v1/procedures_controller.rb b/app/controllers/api/v1/procedures_controller.rb index 4730ce72b..b3360ed2d 100644 --- a/app/controllers/api/v1/procedures_controller.rb +++ b/app/controllers/api/v1/procedures_controller.rb @@ -1,16 +1,4 @@ class API::V1::ProceduresController < APIController - - swagger_controller :procedures, "Procédures" - - swagger_api :show do - summary "Récupérer la liste de ses procédures." - param :path, :id, :integer, "Procédure ID" - param :query, :token, :integer, "Admin TOKEN" - response :ok, "Success", :Procedure - response :unauthorized - response :not_found - end - def show @procedure = current_administrateur.procedures.find(params[:id]).decorate @@ -19,4 +7,5 @@ class API::V1::ProceduresController < APIController Rails.logger.error(e.message) render json: {}, status: 404 end + end diff --git a/config/initializers/grape_swagger_rails.rb b/config/initializers/grape_swagger_rails.rb deleted file mode 100644 index ce5fe122d..000000000 --- a/config/initializers/grape_swagger_rails.rb +++ /dev/null @@ -1,3 +0,0 @@ -GrapeSwaggerRails.options.url = 'api-docs.json' -GrapeSwaggerRails.options.app_name = 'API TéléProcédure Simplifiée' -GrapeSwaggerRails.options.app_url = TPS::Application::URL \ No newline at end of file diff --git a/config/initializers/swagger-docs.rb b/config/initializers/swagger-docs.rb deleted file mode 100644 index c24e53455..000000000 --- a/config/initializers/swagger-docs.rb +++ /dev/null @@ -1,21 +0,0 @@ -Swagger::Docs::Config.register_apis({ - "1.0" => { - # the extension used for the API - # :api_extension_type => :json, - # the output location where your .json files are written to - :api_file_path => "public", - # the URL base path to your API - :base_path => TPS::Application::URL, - # if you want to delete all .json files at each generation - :clean_directory => false, - # Ability to setup base controller for each api version. Api::V1::SomeController for example. - # :parent_controller => API::V1, - # add custom attributes to api-docs - :attributes => { - :info => { - "title" => "API TéléProcédure Simplifiée", - "description" => "", - } - } - } - }) \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 277a632ca..db5e5f748 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,8 +28,6 @@ Rails.application.routes.draw do root 'root#index' - mount GrapeSwaggerRails::Engine => '/docs' - namespace :france_connect do get 'particulier' => 'particulier#login' get 'particulier/callback' => 'particulier#callback' diff --git a/public/api-docs.json b/public/api-docs.json deleted file mode 100644 index 0eb9c7b4a..000000000 --- a/public/api-docs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "apiVersion": "1.0", - "swaggerVersion": "1.2", - "basePath": "http://localhost:3000", - "apis": [ - { - "path": "/api/v1/dossiers.{format}", - "description": "Dossiers" - }, - { - "path": "/api/v1/procedures.{format}", - "description": "Procédures" - } - ], - "authorizations": null, - "info": { - "title": "API TéléProcédure Simplifiée", - "description": "" - } -} \ No newline at end of file diff --git a/public/api/v1/dossiers.json b/public/api/v1/dossiers.json deleted file mode 100644 index 6dce65d06..000000000 --- a/public/api/v1/dossiers.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "apiVersion": "1.0", - "swaggerVersion": "1.2", - "basePath": "http://localhost:3000", - "resourcePath": "dossiers", - "apis": [ - { - "path": "/api/v1/procedures/{procedure_id}/dossiers", - "operations": [ - { - "summary": "Récupérer la liste de ses dossiers.", - "parameters": [ - { - "paramType": "path", - "name": "procedure_id", - "type": "integer", - "description": null, - "required": false - }, - { - "paramType": "query", - "name": "token", - "type": "integer", - "description": null, - "required": false - } - ], - "responseMessages": [ - { - "code": 200, - "responseModel": "Dossier", - "message": "Success" - }, - { - "code": 401, - "responseModel": null, - "message": "Unauthorized" - }, - { - "code": 404, - "responseModel": null, - "message": "Not Found" - } - ], - "nickname": "API::V1::Dossiers#index", - "method": "get" - } - ] - }, - { - "path": "/api/v1/procedures/{procedure_id}/dossiers/{id}", - "operations": [ - { - "summary": "Récupérer le détails d'un dossier.", - "parameters": [ - { - "paramType": "path", - "name": "procedure_id", - "type": "integer", - "description": null, - "required": false - }, - { - "paramType": "path", - "name": "id", - "type": "integer", - "description": null, - "required": false - }, - { - "paramType": "query", - "name": "token", - "type": "integer", - "description": null, - "required": false - } - ], - "responseMessages": [ - { - "code": 200, - "responseModel": "Dossier", - "message": "Success" - }, - { - "code": 401, - "responseModel": null, - "message": "Unauthorized" - }, - { - "code": 404, - "responseModel": null, - "message": "Not Found" - } - ], - "nickname": "API::V1::Dossiers#show", - "method": "get" - } - ] - } - ], - "authorizations": null -} \ No newline at end of file diff --git a/public/api/v1/procedures.json b/public/api/v1/procedures.json deleted file mode 100644 index ae4338a59..000000000 --- a/public/api/v1/procedures.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "apiVersion": "1.0", - "swaggerVersion": "1.2", - "basePath": "http://localhost:3000", - "resourcePath": "procedures", - "apis": [ - { - "path": "/api/v1/procedures/{id}", - "operations": [ - { - "summary": "Récupérer la liste de ses procédures.", - "parameters": [ - { - "paramType": "path", - "name": "id", - "type": "integer", - "description": null, - "required": false - }, - { - "paramType": "query", - "name": "token", - "type": "integer", - "description": null, - "required": false - } - ], - "responseMessages": [ - { - "code": 200, - "responseModel": "Procedure", - "message": "Success" - }, - { - "code": 401, - "responseModel": null, - "message": "Unauthorized" - }, - { - "code": 404, - "responseModel": null, - "message": "Not Found" - } - ], - "nickname": "API::V1::Procedures#show", - "method": "get" - } - ] - } - ], - "authorizations": null -} \ No newline at end of file