Last active
October 23, 2021 05:12
-
-
Save alekseyl/3132307b607449e8fc451a5b71db0a3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AutocompleteControllerDoc | |
include Swagger::Blocks | |
swagger_path '/autocomplete.json' do | |
operation :get, | |
summary: 'Fetches autocompletes on Cards titles and tags', | |
description: 'Returns nearest completions for words in card titles and tags,'\ | |
' respects card restrictions and privacy rules', | |
tags: ['autocomple'] do | |
# predefined and preregistered params | |
parameter :page | |
extend SearchParams | |
extend SwaggerResponses::NotAuthorized | |
response 200, description: 'Autocomplete results' do | |
schema do | |
property :data, required: [:cards_words, :tags, :authors, :types] do | |
array :cards_words, :string | |
array :tags, :string | |
array :types, :string, enum: Card::TYPES | |
array :authors, :UserShort | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment