Skip to content

Commit bb9e6cf

Browse files
committed
Search: Add property prefix search OpenAPI definition
Bug: T399270 Change-Id: I05fbc1a8ab3e11d94a38f9d60918c9252594cd41
1 parent d173a30 commit bb9e6cf

File tree

3 files changed

+413
-6
lines changed

3 files changed

+413
-6
lines changed

repo/domains/search/specs/global/responses.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ module.exports = {
7171
"id": "P123",
7272
"display-label": { "language": "en", "value": "taxon name" },
7373
"description": { "language": "en", "value": "scientific name of a taxon" },
74-
"match": { "type": "label", "language": "en", "text": "taxon" }
74+
"match": { "type": "label", "language": "en", "text": "taxon name" }
7575
},
7676
{
7777
"id": "P234",
7878
"display-label": { "language": "en", "value": "taxon rank" },
7979
"description": { "language": "en", "value": "level in a taxonomic hierarchy" },
80-
"match": { "type": "label", "language": "en", "text": "taxon" }
80+
"match": { "type": "label", "language": "en", "text": "taxon rank" }
8181
}
8282
]
8383
}
@@ -108,4 +108,28 @@ module.exports = {
108108
}
109109
}
110110
},
111+
"SuggestPropertySuccess": {
112+
"description": "A list of search results",
113+
"content": {
114+
"application/json": {
115+
"schema": schemaParts.SearchPropertyResultList,
116+
"example": {
117+
"results": [
118+
{
119+
"id": "P123",
120+
"display-label": { "language": "en", "value": "taxon name" },
121+
"description": { "language": "en", "value": "scientific name of a taxon" },
122+
"match": { "type": "label", "language": "en", "text": "taxon name" }
123+
},
124+
{
125+
"id": "P234",
126+
"display-label": { "language": "en", "value": "taxon rank" },
127+
"description": { "language": "en", "value": "level in a taxonomic hierarchy" },
128+
"match": { "type": "label", "language": "en", "text": "taxon rank" }
129+
}
130+
]
131+
}
132+
}
133+
}
134+
},
111135
};

repo/domains/search/specs/index.fragment.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,27 @@ const openapi = {
7474
"400": { "$ref": "#/components/responses/BadRequest" }
7575
}
7676
}
77+
},
78+
"/v0/suggest/properties": {
79+
"get": {
80+
"operationId": "simplePropertySuggest",
81+
"tags": [ "property search" ],
82+
"summary": "[WIP] Simple Property search by prefix, for labels and aliases",
83+
"description": "This endpoint is currently in development and is not recommended for production use.",
84+
"parameters": [
85+
{
86+
...parameters.SearchQuery,
87+
"example": "taxon"
88+
},
89+
{ "$ref": "#/components/parameters/SearchLanguage" },
90+
{ "$ref": "#/components/parameters/Limit" },
91+
{ "$ref": "#/components/parameters/Offset" },
92+
],
93+
"responses": {
94+
"200": { "$ref": "#/components/responses/SuggestPropertySuccess" },
95+
"400": { "$ref": "#/components/responses/BadRequest" }
96+
}
97+
}
7798
}
7899
},
79100
"components": {

0 commit comments

Comments
 (0)