complete API swagger documentation
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
require "grape"
|
||||
require "grape-swagger"
|
||||
require "ostruct"
|
||||
|
||||
class Api::Base < Grape::API
|
||||
format :json
|
||||
default_format :json
|
||||
content_type :json, "application/json"
|
||||
|
||||
helpers do
|
||||
@@ -17,9 +18,7 @@ class Api::Base < Grape::API
|
||||
|
||||
resource :entries do
|
||||
desc "Return public entries in all languages",
|
||||
is_array: true,
|
||||
success: Api::Entities::Entry,
|
||||
produces: [ "application/json" ]
|
||||
attributes: OpenStruct.new(success: nil, produces: nil)
|
||||
params do
|
||||
optional :since,
|
||||
type: String,
|
||||
@@ -46,14 +45,4 @@ class Api::Base < Grape::API
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
add_swagger_documentation(
|
||||
info: {
|
||||
title: "Sanasto Wiki API",
|
||||
description: "Public sync API for Sanasto Wiki glossary entries."
|
||||
},
|
||||
mount_path: "/swagger",
|
||||
hide_documentation_path: true,
|
||||
format: :json
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user