Skip to content

Commit 6431727

Browse files
committed
refactor for multiple host path within openapi3 Here specs
1 parent 80d797f commit 6431727

File tree

10 files changed

+1596
-1349
lines changed

10 files changed

+1596
-1349
lines changed

openapi/here.yaml

Lines changed: 0 additions & 1275 deletions
This file was deleted.

openapi/here_autocomplete.yaml

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
2+
swagger: "2.0"
3+
info:
4+
title: Geocoding and Search API v7
5+
version: '7.65'
6+
description: This document describes the Geocoding and Search API.
7+
8+
host: autocomplete.search.hereapi.com
9+
basePath: "/v1"
10+
parameters:
11+
apiKey:
12+
description: |
13+
API key used to authorize requests.
14+
For more information, see https://developer.here.com/documentation/authentication/dev_guide/topics/api-key-credentials.html.
15+
name: apiKey
16+
type: string
17+
required: true
18+
in: query
19+
minLength: 1
20+
qAutocomplete:
21+
name: q
22+
description: |
23+
Enter a free-text query
24+
25+
Examples:
26+
* `ber`, `berl`, `berli`, ...
27+
* `berlin+p`, `berlin+paris`, `berlin+parise`, ...
28+
* `berlin+pariser+20`
29+
30+
_Note: Whitespace, urls, email addresses, or other out-of-scope queries will yield no results._
31+
in: query
32+
required: true
33+
type: string
34+
minLength: 1
35+
inAutocompleteGeocode:
36+
name: in
37+
description: |+
38+
Search within a geographic area. This is a hard filter. Results will be returned if they are located within the specified area.
39+
40+
A geographic area can be
41+
42+
* a country (or multiple countries), provided as comma-separated [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country codes
43+
44+
The country codes are to be provided in all uppercase.
45+
46+
Format: `countryCode:{countryCode}[,{countryCode}]*`
47+
48+
Examples:
49+
* `countryCode:USA`
50+
* `countryCode:CAN,MEX,USA`
51+
52+
in: query
53+
required: false
54+
type: string
55+
minLength: 1
56+
57+
limitAutocomplete:
58+
name: limit
59+
description: Maximum number of results to be returned.
60+
in: query
61+
required: false
62+
type: integer
63+
minimum: 1
64+
maximum: 20
65+
default: 5
66+
67+
langAutocomplete:
68+
name: lang
69+
description: |
70+
Select the preferred response language for result rendering from a list of BCP47 compliant Language Codes.
71+
The autocomplete endpoint tries to detect the query language based on matching name variants and then chooses the same language for the response.
72+
73+
Therefore the end-user can see and recognize all the entered terms in the same language as in the query.
74+
The specified preferred language is used only for not matched address tokens and for matched address tokens in case of ambiguity
75+
in: query
76+
type: string
77+
minLength: 1
78+
default: it_IT
79+
80+
definitions:
81+
Address:
82+
type: object
83+
properties:
84+
label:
85+
type: string
86+
description: 'Assembled address value built out of the address components
87+
according to the regional postal rules. These are the same rules for all
88+
endpoints. It may not include all the input terms. For example: "Schulstraße
89+
4, 32547 Bad Oeynhausen, Germany"'
90+
countryCode:
91+
type: string
92+
description: 'A three-letter country code. For example: "DEU"'
93+
countryName:
94+
type: string
95+
description: 'The localised country name. For example: "Deutschland"'
96+
stateCode:
97+
type: string
98+
description: 'A state code or state name abbreviation – country specific.
99+
For example, in the United States it is the two letter state abbreviation:
100+
"CA" for California.'
101+
state:
102+
type: string
103+
description: 'The state division of a country. For example: "North Rhine-Westphalia"'
104+
countyCode:
105+
type: string
106+
description: 'A county code or county name abbreviation – country specific.
107+
For example, for Italy it is the province abbreviation: "RM" for Rome.'
108+
county:
109+
type: string
110+
description: A division of a state; typically, a secondary-level administrative
111+
division of a country or equivalent.
112+
city:
113+
type: string
114+
description: 'The name of the primary locality of the place. For example:
115+
"Bad Oyenhausen"'
116+
district:
117+
type: string
118+
description: 'A division of city; typically an administrative unit within
119+
a larger city or a customary name of a city''s neighborhood. For example:
120+
"Bad Oyenhausen"'
121+
subdistrict:
122+
type: string
123+
description: 'A subdivision of a district. For example: "Minden-Lübbecke"'
124+
street:
125+
type: string
126+
description: 'Name of street. For example: "Schulstrasse"'
127+
block:
128+
type: string
129+
description: Name of block.
130+
subblock:
131+
type: string
132+
description: Name of sub-block.
133+
postalCode:
134+
type: string
135+
description: 'An alphanumeric string included in a postal address to facilitate
136+
mail sorting, such as post code, postcode, or ZIP code. For example: "32547"'
137+
houseNumber:
138+
type: string
139+
description: 'House number. For example: "4"'
140+
ErrorResponse:
141+
type: object
142+
required:
143+
- status
144+
- title
145+
- correlationId
146+
- requestId
147+
properties:
148+
status:
149+
type: integer
150+
format: int32
151+
description: The HTTP status code
152+
title:
153+
type: string
154+
description: Human-readable error description
155+
code:
156+
type: string
157+
description: Error code
158+
cause:
159+
type: string
160+
description: Human-readable explanation for the error
161+
action:
162+
type: string
163+
description: Human-readable action for the user
164+
correlationId:
165+
type: string
166+
description: Auto-generated ID univocally identifying this request
167+
requestId:
168+
type: string
169+
description: Request identifier provided by the user
170+
171+
OpenSearchAutocompleteResponse:
172+
type: object
173+
required:
174+
- items
175+
properties:
176+
items:
177+
type: array
178+
items:
179+
$ref: "#/definitions/AutocompleteResultItem"
180+
description: The results are presented as a JSON list of candidates in ranked
181+
order (most-likely to least-likely) based on the matched location criteria.
182+
AutocompleteResultItem:
183+
type: object
184+
required:
185+
- title
186+
- address
187+
properties:
188+
title:
189+
type: string
190+
description: 'The unified display name of this result item. The result title
191+
is composed so that the customer application can use it to render the
192+
suggestions with highlighting. It is build in a unified way for all the
193+
countries starting from the country name and down to the address line.
194+
It is build out of the address components that are important for the end-user
195+
to recognize and eventually to choose a result and includes all the input
196+
terms. For example: "Germany, 32547, Bad Oeynhausen, Schulstraße 4"'
197+
id:
198+
type: string
199+
description: The unique identifier for the result item. This ID can be used
200+
for a Look Up by ID search as well.
201+
resultType:
202+
type: string
203+
enum:
204+
- administrativeArea
205+
- locality
206+
- street
207+
- intersection
208+
- addressBlock
209+
- houseNumber
210+
- postalCodePoint
211+
- place
212+
description: 'WARNING: The resultType values ''intersection'' and ''postalCodePoint''
213+
are in BETA state'
214+
houseNumberType:
215+
type: string
216+
enum:
217+
- PA
218+
- interpolated
219+
localityType:
220+
type: string
221+
enum:
222+
- postalCode
223+
- subdistrict
224+
- district
225+
- city
226+
administrativeAreaType:
227+
type: string
228+
enum:
229+
- county
230+
- state
231+
- country
232+
address:
233+
$ref: "#/definitions/Address"
234+
description: Detailed address of the result item.
235+
distance:
236+
type: integer
237+
format: int64
238+
description: 'The distance from the search center to this result item in
239+
meters. For example: "172039"'
240+
paths:
241+
"/autocomplete":
242+
get:
243+
operationId: autocomplete
244+
summary: Autocomplete
245+
description: 'BETA: This endpoint completes the few entered keystrokes to the
246+
valid street address or administrative area to speed-up entering the address
247+
queries.'
248+
parameters:
249+
- $ref: "#/parameters/apiKey"
250+
- $ref: "#/parameters/qAutocomplete"
251+
- $ref: "#/parameters/inAutocompleteGeocode"
252+
- $ref: "#/parameters/limitAutocomplete"
253+
- $ref: "#/parameters/langAutocomplete"
254+
responses:
255+
'200':
256+
description: The search results.
257+
schema:
258+
$ref: "#/definitions/OpenSearchAutocompleteResponse"
259+
'400':
260+
description: 'Client error: request failed validation.'
261+
schema:
262+
$ref: "#/definitions/ErrorResponse"
263+
'405':
264+
description: 'Client error: http method not supported.'
265+
schema:
266+
$ref: "#/definitions/ErrorResponse"
267+
'503':
268+
description: Temporary server error.
269+
schema:
270+
$ref: "#/definitions/ErrorResponse"
271+
272+

0 commit comments

Comments
 (0)