Update api_spec.md

This commit is contained in:
Levi Lesches 2025-03-24 19:29:31 -04:00 committed by GitHub
parent 6d7583ccf9
commit 0261663e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,13 +12,13 @@ being a json list of urls to each of all the trips over the course of the week,
## `/trips/{id}` ## `/trips/{id}`
json object describing a route, I'm planning on this having an infinite cache time, if a route changes a new id will be made for the route after the change json object describing a route, I'm planning on this having an infinite cache time, if a route changes a new id will be made for the route after the change
```json ```yaml
{ {
"_links":{ "_links":{
"self":{ "self":{
"href":"https://$base_domain/trips/{id}" "href":"https://$base_domain/trips/{id}"
}, },
// stops in order of when the bus reaches them # stops in order of when the bus reaches them
"stops": [{ "stops": [{
"href":"https://$base_domain/stops/{id}", "href":"https://$base_domain/stops/{id}",
"lattitude":{lattitude}, "lattitude":{lattitude},
@ -38,13 +38,13 @@ json object describing a route, I'm planning on this having an infinite cache ti
## `/stops/{id}` ## `/stops/{id}`
```json ```yaml
{ {
"_links":{ "_links":{
"self":{ "self":{
"href":"https://$base_domain/stops/{id}" "href":"https://$base_domain/stops/{id}"
}, },
// trips that make use of the stop in arbitrary order # trips that make use of the stop in arbitrary order
"trips": [ "trips": [
{ {
"href":"https://$base_domain/trips/{id}", "href":"https://$base_domain/trips/{id}",
@ -57,7 +57,7 @@ json object describing a route, I'm planning on this having an infinite cache ti
``` ```
`/path?start_lat={lattitude}&start_lon={longitude}&end_lat={lattitude}&end_lon={longitude}&time={unix_epoch}` `/path?start_lat={lattitude}&start_lon={longitude}&end_lat={lattitude}&end_lon={longitude}&time={unix_epoch}`
```json ```yaml
{ {
"_links":{ "_links":{
"self":{ "self":{
@ -71,14 +71,15 @@ json object describing a route, I'm planning on this having an infinite cache ti
}, },
"enter_bus":{ "enter_bus":{
"href":"https://$base_domain/stops/{id}", "href":"https://$base_domain/stops/{id}",
"lattitude": {lattitude}, "lattitude": # {lattitude},
"longitude": {longitude} "longitude": # {longitude}
}, },
"exit_bus":{ "exit_bus":{
"href":"https://$base_domain/stops/{id}", "href":"https://$base_domain/stops/{id}",
"lattitude": {lattitude}, "lattitude": # {lattitude},
"longitude": {longitude} "longitude": # {longitude}
}, },
}
] ]
}, },
} }