Skip to content

Commit 4bef588

Browse files
committed
feat: Add distance tolls specifications
1 parent b012869 commit 4bef588

File tree

5 files changed

+125
-0
lines changed

5 files changed

+125
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
servers:
2+
- url: https://api.woosmap.com
3+
tags:
4+
- Distance API
5+
description: >
6+
Get Tolls
7+
security:
8+
- PublicApiKeyAuth: []
9+
RefererHeader: []
10+
- PrivateApiKeyAuth: []
11+
- PrivateApiKeyHeaderAuth: []
12+
parameters:
13+
- $ref: "../../parameters/distance/origin.yml"
14+
- $ref: "../../parameters/distance/destination.yml"
15+
- $ref: "../../parameters/distance/mode.yml"
16+
- $ref: "../../parameters/distance/language.yml"
17+
- $ref: "../../parameters/distance/units.yml"
18+
- $ref: "../../parameters/distance/alternatives.yml"
19+
- $ref: "../../parameters/distance/waypoints.yml"
20+
- $ref: "../../parameters/distance/method.yml"
21+
- $ref: "../../parameters/distance/departure_time.yml"
22+
- $ref: "../../parameters/distance/arrival_time.yml"
23+
24+
responses:
25+
"200":
26+
description: Tolls successfully retrieved
27+
content:
28+
application/json:
29+
schema:
30+
$ref: "../../schemas/DistanceRouteResponse.yml"
31+
examples:
32+
default:
33+
summary: Distance Tolls Result for driving from origin `49.31067,4.14525` to destination `49.31344,4.15293` and retrieving alternatives routes.
34+
value:
35+
$ref: "../../responses/woosmap_http_distance_route_response.yml"
36+
"401":
37+
description: Unauthorized. Incorrect authentication credentials.
38+
content:
39+
application/json:
40+
schema:
41+
$ref: "../../schemas/Error401.yml"
42+
examples:
43+
Unauthorized:
44+
summary: Error 401
45+
value:
46+
detail: "Incorrect authentication credentials. Please check or use a valid API Key"
47+
"403":
48+
description: Forbidden. This Woosmap API is not enabled for this project.
49+
content:
50+
application/json:
51+
schema:
52+
$ref: "../../schemas/Error403.yml"
53+
examples:
54+
Forbidden:
55+
summary: Error 403
56+
value:
57+
detail: "This Woosmap API is not enabled for this project."
58+
"429":
59+
description: Too Many Requests. The rate limit for this endpoint has been exceeded.
60+
content:
61+
application/json:
62+
schema:
63+
$ref: "../../schemas/Error429.yml"
64+
examples:
65+
Forbidden:
66+
summary: Error 429
67+
value:
68+
detail: "The rate limit for this endpoint has been exceeded"
69+
x-codeSamples:
70+
- $ref: "../../snippets/woosmap_http_distance_route/woosmap_http_distance_route.curl.yml"
71+
- $ref: "../../snippets/woosmap_http_distance_route/woosmap_http_distance_route.javascript.yml"
72+
- $ref: "../../snippets/woosmap_http_distance_route/woosmap_http_distance_route.python.yml"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
title: DistanceTollsElementsResponse
2+
type: object
3+
description: Attributes describing routes from an origin to a destination returned in distance tolls response.
4+
required: [overview_polyline, bounds, legs]
5+
properties:
6+
overview_polyline:
7+
$ref: "./EncodedPolyline.yml"
8+
bounds:
9+
$ref: "./Bounds.yml"
10+
legs:
11+
type: array
12+
description: Legs part of the route response
13+
items:
14+
$ref: "./DistanceTollsLeg.yml"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
title: DistanceLeg
2+
type: object
3+
description: Leg in a route
4+
properties:
5+
distance:
6+
$ref: "./DistanceValue.yml"
7+
duration:
8+
$ref: "./DurationValue.yml"
9+
start_location:
10+
$ref: "./LatLngLiteral.yml"
11+
end_location:
12+
$ref: "./LatLngLiteral.yml"
13+
tolls:
14+
type: object
15+
additionalProperties: {}
16+
description: the ending address of the leg
17+
example: "{tolls datas}"
18+
example: {
19+
"distance": { "text": "1 km", "value": 1038 },
20+
"duration": { "text": "1 min", "value": 75 },
21+
"start_location": { "lat": 49.31067, "lng": 4.14525 },
22+
"end_location": { "lat": 49.31344, "lng": 4.15293 }
23+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
title: DistanceTollsResponse
2+
type: object
3+
description: Attributes describing a distance tolls response.
4+
properties:
5+
status:
6+
$ref: "./DistanceStatus.yml"
7+
routes:
8+
description: Contains an array of routes with tolls informations from origin to destination
9+
type: array
10+
items:
11+
$ref: "./DistanceTollsElementsResponse.yml"
12+
13+
# example:
14+
# $ref: "../responses/woosmap_http_distance_tolls_response.yml"

specification/schemas/_index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ DistanceRouteElementsResponse:
178178
$ref: "./DistanceRouteElementsResponse.yml"
179179
DistanceRouteResponse:
180180
$ref: "./DistanceRouteResponse.yml"
181+
DistanceTollsResponse:
182+
$ref: "./DistanceTollsResponse.yml"
181183
DistanceStatus:
182184
$ref: "./DistanceStatus.yml"
183185
DistanceMatrixRequest:

0 commit comments

Comments
 (0)