{ "openapi" : "3.0.3", "info" : { "title" : "roadquality", "version" : "0.0.13", "description" : "Crowd-sourced road quality data" }, "paths" : { "/info" : { "get" : { "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsVersionInfo" } } } } } } }, "/mapRoutes/snap" : { "get" : { "parameters" : [ { "name" : "lat", "in" : "query", "required" : true, "schema" : { "type" : "number", "format" : "double" } }, { "name" : "lng", "in" : "query", "required" : true, "schema" : { "type" : "number", "format" : "double" } } ], "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsPoint" } } } } } } }, "/mapRoutes/{points}" : { "get" : { "parameters" : [ { "name" : "points", "in" : "path", "description" : "Comma separated lnglat, semicolon separated points", "required" : true, "schema" : { "type" : "string" }, "example" : "-79.85386,43.263658;-79.855403,43.263368" } ], "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsMapRoute" } } } } } } }, "/segmentRatings" : { "get" : { "parameters" : [ { "name" : "id", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } } ], "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegmentRating" } } } } } }, "post" : { "parameters" : [ { "name" : "id", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } }, { "name" : "currentZoomLevel", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegmentCreateForm" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegment" } } } }, "400" : { "description" : "Bad request", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } }, "delete" : { "parameters" : [ { "name" : "id", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } } ], "responses" : { "202" : { "description" : "Response 202", "content" : { "application/json" : { "schema" : { "type" : "boolean" } } } }, "404" : { "description" : "Not found", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } } }, "/segments" : { "get" : { "description" : "Search all segments", "parameters" : [ { "name" : "segmentId", "in" : "query", "required" : false, "schema" : { "type" : "string", "format" : "uuid" } } ], "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegment" } } } } } } }, "put" : { "parameters" : [ { "name" : "segmentId", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegmentUpdateForm" } } }, "required" : true }, "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegment" } } } }, "400" : { "description" : "Bad request", "content" : { "application/json" : { "schema" : { "type" : "string" } } } }, "404" : { "description" : "Not found", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } }, "post" : { "parameters" : [ { "name" : "currentZoomLevel", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32" } }, { "name" : "hidden", "in" : "query", "required" : false, "schema" : { "type" : "boolean" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegmentCreateForm" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegment" } } } }, "400" : { "description" : "Bad request", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } } }, "/segments/boundingbox" : { "get" : { "description" : "Search all segments within a bounding box", "parameters" : [ { "name" : "xmin", "in" : "query", "required" : false, "schema" : { "type" : "number", "format" : "double" } }, { "name" : "ymin", "in" : "query", "required" : false, "schema" : { "type" : "number", "format" : "double" } }, { "name" : "xmax", "in" : "query", "required" : false, "schema" : { "type" : "number", "format" : "double" } }, { "name" : "ymax", "in" : "query", "required" : false, "schema" : { "type" : "number", "format" : "double" } } ], "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsSegment" } } } } }, "404" : { "description" : "Not found", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } } }, "/users" : { "get" : { "responses" : { "200" : { "description" : "Successful response", "content" : { "application/json" : { "schema" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsUser" } } } } }, "401" : { "description" : "Unauthorized", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } }, "put" : { "parameters" : [ { "name" : "userId", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsUserUpdateForm" } } }, "required" : true }, "responses" : { "202" : { "description" : "Response 202", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsUser" } } } }, "404" : { "description" : "Not found", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } }, "delete" : { "parameters" : [ { "name" : "userId", "in" : "query", "required" : true, "schema" : { "type" : "string", "format" : "uuid" } } ], "responses" : { "202" : { "description" : "Response 202", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0ModelsUser" } } } }, "404" : { "description" : "Not found", "content" : { "application/json" : { "schema" : { "type" : "string" } } } } } } } }, "components" : { "schemas" : { "ComTrifectalabsRoadqualityV0ModelsSegmentCreateForm" : { "description" : "Form the client uses to create a segment", "type" : "object", "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" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsSurfaceType" }, "pathType" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsPathType" } } }, "ComTrifectalabsRoadqualityV0ModelsVersionInfo" : { "type" : "object", "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" } } }, "ComTrifectalabsRoadqualityV0ModelsSegment" : { "description" : "A segment of road which will be rated and tagged", "type" : "object", "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" } } }, "ComTrifectalabsRoadqualityV0ModelsMapRoute" : { "description" : "A routable path on a map - not necessarily a segment", "type" : "object", "required" : [ "polyline", "distance" ], "properties" : { "polyline" : { "type" : "string" }, "distance" : { "type" : "number", "format" : "double" } } }, "ComTrifectalabsRoadqualityV0ModelsSegmentUpdateForm" : { "description" : "Form to modify an existing segment", "type" : "object", "properties" : { "name" : { "type" : "string" }, "description" : { "type" : "string" }, "surfaceRating" : { "type" : "integer", "format" : "int32" }, "trafficRating" : { "type" : "integer", "format" : "int32" }, "surfaceType" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsSurfaceType" }, "pathType" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsPathType" } } }, "ComTrifectalabsRoadqualityV0ModelsUserUpdateForm" : { "description" : "A form to update attributes about a user", "type" : "object", "properties" : { "birthdate" : { "type" : "string", "format" : "date-time" }, "sex" : { "type" : "string" } } }, "ComTrifectalabsRoadqualityV0ModelsSegmentRating" : { "description" : "A rating that is supplied with the segment", "type" : "object", "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" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsSurfaceType" }, "pathType" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsPathType" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" }, "deletedAt" : { "type" : "string", "format" : "date-time" } } }, "ComTrifectalabsRoadqualityV0ModelsUser" : { "description" : "A user of the service", "type" : "object", "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" : { "$ref" : "#/components/schemas/ComTrifectalabsRoadqualityV0EnumsUserRole" }, "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" } } }, "ComTrifectalabsRoadqualityV0ModelsPoint" : { "description" : "A longitudinal or latitudinal coordatine", "type" : "object", "required" : [ "lat", "lng" ], "properties" : { "lat" : { "type" : "number", "format" : "double" }, "lng" : { "type" : "number", "format" : "double" } } }, "ComTrifectalabsRoadqualityV0EnumsUserRole" : { "description" : "The type of user (user or admin)", "type" : "string", "enum" : [ "user", "admin" ] }, "ComTrifectalabsRoadqualityV0EnumsPathType" : { "description" : "The level of dedication of the segment to cycling", "type" : "string", "enum" : [ "shared", "dedicatedLane", "bikePath" ] }, "ComTrifectalabsRoadqualityV0EnumsSurfaceType" : { "description" : "The surface type of a segment (road type)", "type" : "string", "enum" : [ "gravel", "asphalt", "dirt" ] } } } }