1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/config/initializers/apipie.rb

29 lines
1015 B
Ruby
Raw Normal View History

2020-06-15 17:44:56 +02:00
# frozen_string_literal: true
2016-05-05 15:02:02 +02:00
Apipie.configure do |config|
2020-06-15 17:44:56 +02:00
config.app_name = 'Fab-manager'
config.api_base_url = '/open_api'
config.doc_base_url = '/open_api/doc'
2016-05-05 15:02:02 +02:00
# where is your API defined?
config.api_controllers_matcher = "#{Rails.root}/app/controllers/open_api/v1/*.rb"
config.validate = false
2020-06-15 17:44:56 +02:00
config.translate = false
config.default_locale = nil
config.app_info['v1'] = <<-RDOC
2016-05-05 15:02:02 +02:00
= Pagination
---
Pagination is done using headers. Following RFC-5988 standard for web linking.
It uses headers *Link*, *Total* and *Per-Page*.
2017-10-05 11:31:50 +02:00
= Authentication
2016-05-05 15:02:02 +02:00
---
2017-10-05 11:31:50 +02:00
Authentication is done using *Authorization* header.
2016-05-05 15:02:02 +02:00
You just have to set header *Authorization* to <tt>Token token=YOUR_TOKEN</tt> for every request.
2017-10-05 11:31:50 +02:00
= Json
---
Depending on your client, you may have to set header <tt>Accept: application/json</tt> for every request,
otherwise some clients may request *html* by default which will result in error.
2020-06-15 17:44:56 +02:00
RDOC
2016-05-05 15:02:02 +02:00
end