-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch.yaml
72 lines (70 loc) · 2.13 KB
/
Search.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Search
description: Search Microservice
version: "1.0.0"
# the domain of the service
host: despina.128.no
# array of all schemes that your API supports
schemes:
- http
# will be prefixed to all paths
#basePath: /
produces:
- application/json
paths:
/search:
post:
summary: Search for keywords in articles
description: |
Specify whether the search query is partial or complete.
Partial queries return a list of spelling correction suggestions
for each query word, where the last element is a list of suggested completions
(of the last query word).
Complete queries return a list of spelling correction suggestions
for each query word, as well as a list of search results.
parameters:
- name: Partial
in: formData
description: Whether or not the query is a partial search query.
required: true
type: boolean
- name: Query
in: formData
description: A search query, possibly several words, separated by spaces.
required: true
type: string
responses:
200:
description: Spelling feedback and potentially results (if complete search).
schema:
$ref: '#/definitions/Search'
definitions:
Search:
type: object
properties:
spell:
type: array
description: List with lists of spelling suggestions, one for each word in query.
The last list is a list of completions if the Partial argument is true.
items:
$ref: '#/definitions/Search_Spell'
result:
type: array
description: A list of article IDs
items:
$ref: '#/definitions/Search_Results'
Search_Spell:
type: array
description: List of spelling/autocompletion suggestions
items:
type: string
description: suggestion
Search_Results:
type: array
description: List of article suggestions
items:
type: string
description: result id