{"swagger":"2.0","info":{"title":"roadquality","description":"Crowd-sourced road quality data","version":"0.0.13"},"consumes":["application/json"],"produces":["application/json"],"paths":{"/mapRoutes/snap":{"get":{"parameters":[{"name":"lat","in":"query","required":true,"type":"number","format":"double"},{"name":"lng","in":"query","required":true,"type":"number","format":"double"}],"responses":{"200":{"description":"200 response","schema":{"$ref":"#/definitions/point"}}}}},"/mapRoutes/{points}":{"get":{"parameters":[{"name":"points","in":"path","description":"Comma separated lnglat, semicolon separated points","required":true,"type":"string"}],"responses":{"200":{"description":"200 response","schema":{"$ref":"#/definitions/mapRoute"}}}}},"/segments":{"get":{"description":"Search all segments","parameters":[{"name":"segmentId","in":"query","required":false,"type":"string","format":"uuid"}],"responses":{"200":{"description":"200 response","schema":{"type":"array","items":{"$ref":"#/definitions/segment"}}}}},"post":{"parameters":[{"name":"currentZoomLevel","in":"query","required":false,"type":"integer","format":"int32"},{"name":"hidden","in":"query","required":false,"type":"boolean"},{"name":"segmentCreateForm","in":"body","schema":{"$ref":"#/definitions/segmentCreateForm"}}],"responses":{"201":{"description":"201 response","schema":{"$ref":"#/definitions/segment"}},"400":{"description":"400 response","schema":{"$ref":"#/definitions/string"}}}},"put":{"parameters":[{"name":"segmentId","in":"query","required":true,"type":"string","format":"uuid"},{"name":"segmentUpdateForm","in":"body","schema":{"$ref":"#/definitions/segmentUpdateForm"}}],"responses":{"200":{"description":"200 response","schema":{"$ref":"#/definitions/segment"}},"400":{"description":"400 response","schema":{"$ref":"#/definitions/string"}},"404":{"description":"404 response","schema":{"$ref":"#/definitions/string"}}}}},"/segments/boundingbox":{"get":{"description":"Search all segments within a bounding box","parameters":[{"name":"xmin","in":"query","required":false,"type":"number","format":"double"},{"name":"ymin","in":"query","required":false,"type":"number","format":"double"},{"name":"xmax","in":"query","required":false,"type":"number","format":"double"},{"name":"ymax","in":"query","required":false,"type":"number","format":"double"}],"responses":{"200":{"description":"200 response","schema":{"type":"array","items":{"$ref":"#/definitions/segment"}}},"404":{"description":"404 response","schema":{"$ref":"#/definitions/string"}}}}},"/segmentRatings":{"get":{"parameters":[{"name":"id","in":"query","required":true,"type":"string","format":"uuid"}],"responses":{"200":{"description":"200 response","schema":{"$ref":"#/definitions/segmentRating"}}}},"post":{"parameters":[{"name":"id","in":"query","required":true,"type":"string","format":"uuid"},{"name":"currentZoomLevel","in":"query","required":false,"type":"integer","format":"int32"},{"name":"segmentCreateForm","in":"body","schema":{"$ref":"#/definitions/segmentCreateForm"}}],"responses":{"201":{"description":"201 response","schema":{"$ref":"#/definitions/segment"}},"400":{"description":"400 response","schema":{"$ref":"#/definitions/string"}}}},"delete":{"parameters":[{"name":"id","in":"query","required":true,"type":"string","format":"uuid"}],"responses":{"202":{"description":"202 response","schema":{"$ref":"#/definitions/boolean"}},"404":{"description":"404 response","schema":{"$ref":"#/definitions/string"}}}}},"/users":{"get":{"parameters":[],"responses":{"200":{"description":"200 response","schema":{"type":"array","items":{"$ref":"#/definitions/user"}}},"401":{"description":"401 response","schema":{"$ref":"#/definitions/string"}}}},"put":{"parameters":[{"name":"userId","in":"query","required":true,"type":"string","format":"uuid"},{"name":"userUpdateForm","in":"body","schema":{"$ref":"#/definitions/userUpdateForm"}}],"responses":{"202":{"description":"202 response","schema":{"$ref":"#/definitions/user"}},"404":{"description":"404 response","schema":{"$ref":"#/definitions/string"}}}},"delete":{"parameters":[{"name":"userId","in":"query","required":true,"type":"string","format":"uuid"}],"responses":{"202":{"description":"202 response","schema":{"$ref":"#/definitions/user"}},"404":{"description":"404 response","schema":{"$ref":"#/definitions/string"}}}}},"/info":{"get":{"parameters":[],"responses":{"200":{"description":"200 response","schema":{"$ref":"#/definitions/versionInfo"}}}}}},"definitions":{"mapRoute":{"type":"object","description":"A routable path on a map - not necessarily a segment","title":"mapRoute","required":["polyline","distance"],"properties":{"polyline":{"type":"string"},"distance":{"type":"number","format":"double"}}},"point":{"type":"object","description":"A longitudinal or latitudinal coordatine","title":"point","required":["lat","lng"],"properties":{"lat":{"type":"number","format":"double"},"lng":{"type":"number","format":"double"}}},"segment":{"type":"object","description":"A segment of road which will be rated and tagged","title":"segment","required":["id","polyline","created_by","hidden"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polyline":{"type":"string"},"created_by":{"description":"The user who created the segment","type":"string","format":"uuid"},"hidden":{"description":"Whether a segment is user visible or not","type":"boolean"}}},"segmentCreateForm":{"type":"object","description":"Form the client uses to create a segment","title":"segmentCreateForm","required":["polylines","surfaceRating","trafficRating","surfaceType","pathType"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"polylines":{"type":"array","items":{"type":"string"}},"surfaceRating":{"type":"integer","format":"int32"},"trafficRating":{"type":"integer","format":"int32"},"surfaceType":{"type":"string","enum":["gravel","asphalt","dirt"]},"pathType":{"type":"string","enum":["shared","dedicatedLane","bikePath"]}}},"segmentRating":{"type":"object","description":"A rating that is supplied with the segment","title":"segmentRating","required":["id","segmentId","userId","trafficRating","surfaceRating","surfaceType","pathType","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"segmentId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"trafficRating":{"type":"integer","format":"int32"},"surfaceRating":{"type":"integer","format":"int32"},"surfaceType":{"type":"string","enum":["gravel","asphalt","dirt"]},"pathType":{"type":"string","enum":["shared","dedicatedLane","bikePath"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time"}}},"segmentUpdateForm":{"type":"object","description":"Form to modify an existing segment","title":"segmentUpdateForm","properties":{"name":{"type":"string"},"description":{"type":"string"},"surfaceRating":{"type":"integer","format":"int32"},"trafficRating":{"type":"integer","format":"int32"},"surfaceType":{"type":"string","enum":["gravel","asphalt","dirt"]},"pathType":{"type":"string","enum":["shared","dedicatedLane","bikePath"]}}},"user":{"type":"object","description":"A user of the service","title":"user","required":["id","firstName","lastName","email","role","stravaToken","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"type":"string"},"birthdate":{"type":"string","format":"date-time"},"sex":{"type":"string"},"role":{"type":"string","enum":["user","admin"]},"stravaToken":{"description":"Strava API token","type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time"}}},"userUpdateForm":{"type":"object","description":"A form to update attributes about a user","title":"userUpdateForm","properties":{"birthdate":{"type":"string","format":"date-time"},"sex":{"type":"string"}}},"versionInfo":{"type":"object","title":"versionInfo","required":["name","version","scalaVersion","sbtVersion"],"properties":{"name":{"description":"Name of this service","type":"string"},"version":{"description":"Version of this service","type":"string"},"scalaVersion":{"description":"Version of Scala used to build this service","type":"string"},"sbtVersion":{"description":"Version of SBT used to build this service","type":"string"}}}}}