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?
|
2022-08-30 14:16:49 +02:00
|
|
|
config.api_controllers_matcher = Rails.root.join('app/controllers/open_api/v1/*.rb')
|
2016-05-05 15:02:02 +02:00
|
|
|
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
|
|
|
|
---
|
2022-08-30 14:16:49 +02:00
|
|
|
Depending on your client, you may have to set header <tt>Accept: application/json</tt> for every request,
|
2017-10-05 11:31:50 +02:00
|
|
|
otherwise some clients may request *html* by default which will result in error.
|
2022-08-30 14:16:49 +02:00
|
|
|
|
2022-09-06 13:10:05 +02:00
|
|
|
= Amounts
|
|
|
|
---
|
|
|
|
Everywhere in the OpenAPI amounts are reported in cents. For exemple, if you get <tt>{ "amount" : 1000 }</tt>,
|
|
|
|
from the OpenAPI, this means that the price is 10 € (or whatever your currency is).
|
2020-06-15 17:44:56 +02:00
|
|
|
RDOC
|
2016-05-05 15:02:02 +02:00
|
|
|
end
|