Sha256: 667522e0664fbd28ff7498bb4d7b311a582ceea4de2e000e4d1cf63ace1085cb

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

module Workarea
  module Api
    module Admin
      class SwaggerController < Admin::ApplicationController
        include ::Swagger::Blocks

        def index
          controller = self
          self.class.send(:swagger_root) do
            key :swagger, '2.0'

            info do
              key :version, '1.0.0'
              key :title, 'Workarea Admin'
              key :description, 'A backend API for integrating and configuring Workarea'
              key :termsOfService, 'https://workarea.com'
              contact do
                key :name, 'Workarea Product Team'
              end
            end

            key :host, Workarea.config.host
            key :basePath, controller.root_path[0..-2]
            key :schemes, [Rails.application.config.force_ssl ? 'https' : 'http']
            key :consumes, ['application/json']
            key :produces, ['application/json']

            security_definition :BasicAuth do
              key :type, :basic
            end
            security do
              key :BasicAuth, []
            end
          end

          render json: ::Swagger::Blocks.build_root_json(Swagger.klasses)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
workarea-api-4.4.7 admin/app/controllers/workarea/api/admin/swagger_controller.rb
workarea-api-admin-4.4.7 app/controllers/workarea/api/admin/swagger_controller.rb
workarea-api-4.4.6 admin/app/controllers/workarea/api/admin/swagger_controller.rb
workarea-api-admin-4.4.6 app/controllers/workarea/api/admin/swagger_controller.rb