Sha256: 4abf6b05c865847574e2d12c01e5762a1cd06b63461b1af6b075d660cbd52b27

Contents?: true

Size: 847 Bytes

Versions: 5

Compression:

Stored size: 847 Bytes

Contents

require "grape-swagger"
require_relative "../api"

class Api::Base < Grape::API
  content_type :jsonapi, "application/vnd.api+json"
  formatter :json, Grape::Formatter::Jsonapi
  formatter :jsonapi, Grape::Formatter::Jsonapi
  format :jsonapi
  default_error_formatter :json

  mount Api::V1::Root

  # Swagger docs are available at `/api/docs/swagger.json`.
  add_swagger_documentation \
    api_version: "v1",
    array_use_braces: true,
    base_path: "/api",
    doc_version: "1.0",
    endpoint_auth_wrapper: ::WineBouncer::OAuth2,
    hide_documentation_path: true,
    info: {
      title: I18n.t("application.name"),
      description: I18n.t("application.description")
    },
    mount_path: "/docs/swagger"

  # TODO Reintroduce this once we've got `context` in current attributes.
  # before do
  #   Current.context = :api
  # end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bullet_train-api-1.0.17 app/controllers/api/base.rb
bullet_train-api-1.0.16 app/controllers/api/base.rb
bullet_train-api-1.0.15 app/controllers/api/base.rb
bullet_train-api-1.0.14 app/controllers/api/base.rb
bullet_train-api-1.0.13 app/controllers/api/base.rb