lib/rest-ftp-daemon/api/root.rb in rest-ftp-daemon-0.400.0 vs lib/rest-ftp-daemon/api/root.rb in rest-ftp-daemon-0.410.0.pre.1
- old
+ new
@@ -1,6 +1,9 @@
require "grape"
+require 'grape-swagger'
+# require 'grape-swagger/entity'
+# require 'grape-swagger/representable'
module RestFtpDaemon
module API
class Root < Grape::API
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
@@ -32,14 +35,27 @@
format :json
content_type :json, 'application/json; charset=utf-8'
### MOUNTPOINTS
- mount RestFtpDaemon::API::Status => MOUNT_STATUS
- mount RestFtpDaemon::API::Jobs => MOUNT_JOBS
- mount RestFtpDaemon::API::Dashbaord => MOUNT_BOARD
- mount RestFtpDaemon::API::Config => MOUNT_CONFIG
- mount RestFtpDaemon::API::Debug => MOUNT_DEBUG
+ mount RestFtpDaemon::API::Status => MOUNT_STATUS
+ mount RestFtpDaemon::API::Jobs => MOUNT_JOBS
+ mount RestFtpDaemon::API::Dashbaord => MOUNT_BOARD
+ mount RestFtpDaemon::API::Config => MOUNT_CONFIG
+ mount RestFtpDaemon::API::Debug => MOUNT_DEBUG
+
+
+ ### API Documentation
+ add_swagger_documentation hide_documentation_path: true,
+ api_version: Conf.app_ver,
+ doc_version: Conf.app_ver,
+ mount_path: MOUNT_SWAGGER_JSON,
+ info: {
+ title: Conf.app_name,
+ version: Conf.app_ver,
+ description: "API description for #{Conf.app_name} #{Conf.app_ver}",
+ }
+
### INITIALIZATION
def initialize
super