Skip to content

Instantly share code, notes, and snippets.

@alekseyl
Last active October 23, 2021 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekseyl/3132307b607449e8fc451a5b71db0a3d to your computer and use it in GitHub Desktop.
Save alekseyl/3132307b607449e8fc451a5b71db0a3d to your computer and use it in GitHub Desktop.
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