Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
236 lines (235 sloc) 6.38 KB
swagger: "2.0"
info:
description: "This is a very simple RESTful API for the database generated by the [dv8](https://github.com/line72/dv8) scripts. This provides the basic interface needed to make queries. More information can be found at [https://github.com/line72/dv8-api-server](https://github.com/line72/dv8-api-server)."
version: "1.0.0"
title: "dv8"
termsOfService: "https://github.com/line72/dv8-api-server/blob/master/LICENSE"
contact:
email: "line72@line72.net"
license:
name: "MIT"
url: "https://github.com/line72/dv8-api-server/blob/master/LICENSE"
host: "api.dv8.line72.net"
basePath: "/"
tags:
- name: "Routes"
description: "Operations on Bus Routes"
- name: "Trips"
description: "Operations on Trips for specific Routes"
- name: "Waypoints"
description: "Operations on Waypoints for each Trip"
schemes:
- "https"
paths:
/routes:
get:
tags:
- "Routes"
summary: "Get a list of all the available routes"
operationId: "listRoutes"
produces:
- "application/json"
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Route"
/route/{routeId}:
get:
tags:
- "Routes"
summary: "Find a route by ID"
description: "Return a single route."
operationId: "findRouteById"
produces:
- "application/json"
parameters:
- name: "routeId"
in: "path"
description: "ID of route to return"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Route"
400:
description: "Invalid ID supplied"
404:
description: "Route not found"
/route/{routeId}/trips:
get:
tags:
- "Trips"
summary: "Get all the trips for a route."
description: "Returns all the trips for a single route."
operationId: "getTripsByRoute"
produces:
- "application/json"
parameters:
- name: "routeId"
in: "path"
description: "ID of trip"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Trip"
400:
description: "Invalid ID supplied"
404:
description: "Route not found"
/route/{routeId}/trip/{tripId}:
get:
tags:
- "Trips"
summary: "Get a specific trip"
description: ""
operationId: "getTripById"
produces:
- "application/json"
parameters:
- name: "routeId"
in: "path"
description: "ID of route"
required: true
type: "string"
- name: "tripId"
in: "path"
description: "The trip to return"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Trip"
400:
description: "Invalid ID supplied"
404:
description: "Trip or Route not found"
/route/{routeId}/trip/{tripId}/waypoints:
get:
tags:
- "Waypoints"
summary: "Returns the waypoints for a specific trip"
description: "Returns waypoints for a specific trip. The number of waypoints can be very large, and is limited to a default of 1000. Use the additional filters and paging to retrieve all the desired results."
operationId: "getWaypoints"
produces:
- "application/json"
parameters:
- name: "routeId"
in: "path"
description: "ID of route"
required: true
type: "string"
- name: "tripId"
in: "path"
description: "The trip to return"
required: true
type: "string"
- name: "start_date"
in: "query"
required: false
description: "The earliest waypoints to return. Format like 2017-08-22"
type: "string"
- name: "end_date"
in: "query"
required: false
description: "The latest waypoints to return. Format like 2017-08-23"
type: "string"
- name: "limit"
in: "query"
required: false
description: "The maximum number of results to return. This can never exceed 1000"
type: "integer"
format: "int32"
- name: "page"
in: "query"
required: false
description: "The offset page. If your query has more results then the limit allows, run the query again, incrementing the page by 1 to get the next set of results. The first page is page 0, and the second page is page 1."
type: "integer"
format: "int32"
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Waypoint"
definitions:
Route:
type: "object"
required:
- "id"
- "route_id"
- "name"
properties:
id:
type: "string"
example: "1"
route_id:
type: "string"
example: "44"
name:
type: "string"
example: "44 Montclair"
Trip:
type: "object"
properties:
id:
type: "string"
example: "1"
trip_id:
type: "string"
example: "1844"
name:
type: "string"
example: "306"
run_id:
type: "string"
example: "4011"
route_id:
type: "string"
example: "1"
Waypoint:
type: "object"
properties:
id:
type: "string"
example: "1"
date:
type: "string"
format: "date-time"
latitude:
type: "number"
format: "double"
longitude:
type: "number"
format: "double"
op_status:
type: "string"
description: "The current status."
example: "ONTIME"
on_board:
type: "integer"
format: "int32"
description: "The number of passengers currently on board."
direction:
type: "string"
description: "The direction of the trip. I=Inbound. O=Outbound. L=Loop"
example: "I"
driver:
type: "string"
description: "The last name of the bus operator."
example: "Johnson"
trip_id:
type: "string"
example: "1"