complete API swagger documentation
CI / scan_ruby (push) Failing after 29s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 21s
CI / test (push) Failing after 48s

This commit is contained in:
2026-02-04 01:33:02 +01:00
parent a139bde102
commit 441caabb98
6 changed files with 131 additions and 47 deletions
+3 -14
View File
@@ -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