{ "components": { "schemas": { "mapRoute": { "description": "A routable path on a map - not necessarily a segment", "properties": { "polyline": { "type": "string" }, "distance": { "type": "number", "format": "double" } }, "required": [ "polyline", "distance" ], "type": "object" }, "point": { "description": "A longitudinal or latitudinal coordatine", "properties": { "lat": { "type": "number", "format": "double" }, "lng": { "type": "number", "format": "double" } }, "required": [ "lat", "lng" ], "type": "object" }, "segment": { "description": "A segment of road which will be rated and tagged", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "polyline": { "type": "string" }, "created_by": { "type": "string", "format": "uuid", "description": "The user who created the segment" }, "hidden": { "type": "boolean", "description": "Whether a segment is user visible or not" } }, "required": [ "id", "polyline", "created_by", "hidden" ], "type": "object" }, "segmentCreateForm": { "description": "Form the client uses to create a segment", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "polylines": { "items": { "type": "string" }, "type": "array" }, "surfaceRating": { "type": "integer" }, "trafficRating": { "type": "integer" }, "surfaceType": { "$ref": "#/components/schemas/surfaceType" }, "pathType": { "$ref": "#/components/schemas/pathType" } }, "required": [ "polylines", "surfaceRating", "trafficRating", "surfaceType", "pathType" ], "type": "object" }, "segmentRating": { "description": "A rating that is supplied with the segment", "properties": { "id": { "type": "string", "format": "uuid" }, "segmentId": { "type": "string", "format": "uuid" }, "userId": { "type": "string", "format": "uuid" }, "trafficRating": { "type": "integer" }, "surfaceRating": { "type": "integer" }, "surfaceType": { "$ref": "#/components/schemas/surfaceType" }, "pathType": { "$ref": "#/components/schemas/pathType" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "segmentId", "userId", "trafficRating", "surfaceRating", "surfaceType", "pathType", "createdAt", "updatedAt" ], "type": "object" }, "segmentUpdateForm": { "description": "Form to modify an existing segment", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "surfaceRating": { "type": "integer" }, "trafficRating": { "type": "integer" }, "surfaceType": { "$ref": "#/components/schemas/surfaceType" }, "pathType": { "$ref": "#/components/schemas/pathType" } }, "type": "object" }, "user": { "description": "A user of the service", "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/userRole" }, "stravaToken": { "type": "string", "description": "Strava API token" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "firstName", "lastName", "email", "role", "stravaToken", "createdAt", "updatedAt" ], "type": "object" }, "userUpdateForm": { "description": "A form to update attributes about a user", "properties": { "birthdate": { "type": "string", "format": "date-time" }, "sex": { "type": "string" } }, "type": "object" }, "versionInfo": { "properties": { "name": { "type": "string", "description": "Name of this service" }, "version": { "type": "string", "description": "Version of this service" }, "scalaVersion": { "type": "string", "description": "Version of Scala used to build this service" }, "sbtVersion": { "type": "string", "description": "Version of SBT used to build this service" } }, "required": [ "name", "version", "scalaVersion", "sbtVersion" ], "type": "object" }, "pathType": { "description": "The level of dedication of the segment to cycling. Possible values: shared,dedicatedLane,bikePath.", "enum": [ "shared", "dedicatedLane", "bikePath" ], "type": "string" }, "surfaceType": { "description": "The surface type of a segment (road type). Possible values: gravel,asphalt,dirt.", "enum": [ "gravel", "asphalt", "dirt" ], "type": "string" }, "userRole": { "description": "The type of user (user or admin). Possible values: user,admin.", "enum": [ "user", "admin" ], "type": "string" } } }, "info": { "contact": {}, "description": "Crowd-sourced road quality data", "license": {}, "termsOfService": "", "title": "roadquality", "version": "0.0.13" }, "openapi": "3.0.2", "paths": { "/mapRoutes/snap": { "get": { "operationId": "get--mapRoutes-snap", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "number", "format": "double" }, "name": "lat" }, { "deprecated": false, "in": "query", "required": true, "schema": { "type": "number", "format": "double" }, "name": "lng" } ], "responses": { "200": { "description": "com.trifectalabs.roadquality.v0.models.point", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/point" } } }, "headers": {} } }, "tags": [ "mapRoute" ] } }, "/mapRoutes/:points": { "get": { "operationId": "get--mapRoutes-points", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string" }, "description": "Comma separated lnglat, semicolon separated points", "name": "points" } ], "responses": { "200": { "description": "com.trifectalabs.roadquality.v0.models.mapRoute", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/mapRoute" } } }, "headers": {} } }, "tags": [ "mapRoute" ] } }, "/segments": { "get": { "description": "Search all segments", "operationId": "get--segments", "parameters": [ { "deprecated": false, "in": "query", "required": false, "schema": { "type": "string", "format": "uuid" }, "name": "segmentId" } ], "responses": { "200": { "description": "[com.trifectalabs.roadquality.v0.models.segment]", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/segment" }, "type": "array" } } }, "headers": {} } }, "tags": [ "segment" ] }, "post": { "operationId": "post--segments", "parameters": [ { "deprecated": false, "in": "query", "required": false, "schema": { "type": "integer" }, "name": "currentZoomLevel" }, { "deprecated": false, "in": "query", "required": false, "schema": { "type": "boolean" }, "name": "hidden" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segmentCreateForm" } } } }, "responses": { "201": { "description": "com.trifectalabs.roadquality.v0.models.segment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segment" } } }, "headers": {} }, "400": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "segment" ] }, "put": { "operationId": "put--segments", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "segmentId" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segmentUpdateForm" } } } }, "responses": { "200": { "description": "com.trifectalabs.roadquality.v0.models.segment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segment" } } }, "headers": {} }, "400": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} }, "404": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "segment" ] } }, "/segments/boundingbox": { "get": { "description": "Search all segments within a bounding box", "operationId": "get--segments-boundingbox", "parameters": [ { "deprecated": false, "in": "query", "required": false, "schema": { "type": "number", "format": "double" }, "name": "xmin" }, { "deprecated": false, "in": "query", "required": false, "schema": { "type": "number", "format": "double" }, "name": "ymin" }, { "deprecated": false, "in": "query", "required": false, "schema": { "type": "number", "format": "double" }, "name": "xmax" }, { "deprecated": false, "in": "query", "required": false, "schema": { "type": "number", "format": "double" }, "name": "ymax" } ], "responses": { "200": { "description": "[com.trifectalabs.roadquality.v0.models.segment]", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/segment" }, "type": "array" } } }, "headers": {} }, "404": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "segment" ] } }, "/segmentRatings": { "get": { "operationId": "get--segmentRatings", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "id" } ], "responses": { "200": { "description": "com.trifectalabs.roadquality.v0.models.segmentRating", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segmentRating" } } }, "headers": {} } }, "tags": [ "segmentRating" ] }, "post": { "operationId": "post--segmentRatings", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "id" }, { "deprecated": false, "in": "query", "required": false, "schema": { "type": "integer" }, "name": "currentZoomLevel" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segmentCreateForm" } } } }, "responses": { "201": { "description": "com.trifectalabs.roadquality.v0.models.segment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/segment" } } }, "headers": {} }, "400": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "segmentRating" ] }, "delete": { "operationId": "delete--segmentRatings", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "id" } ], "responses": { "202": { "description": "boolean", "content": { "application/json": { "schema": { "type": "boolean" } } }, "headers": {} }, "404": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "segmentRating" ] } }, "/users": { "get": { "operationId": "get--users", "parameters": [], "responses": { "200": { "description": "[com.trifectalabs.roadquality.v0.models.user]", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/user" }, "type": "array" } } }, "headers": {} }, "401": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "user" ] }, "put": { "operationId": "put--users", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "userId" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/userUpdateForm" } } } }, "responses": { "202": { "description": "com.trifectalabs.roadquality.v0.models.user", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user" } } }, "headers": {} }, "404": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "user" ] }, "delete": { "operationId": "delete--users", "parameters": [ { "deprecated": false, "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "userId" } ], "responses": { "202": { "description": "com.trifectalabs.roadquality.v0.models.user", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user" } } }, "headers": {} }, "404": { "description": "string", "content": { "application/json": { "schema": { "type": "string" } } }, "headers": {} } }, "tags": [ "user" ] } }, "/info": { "get": { "operationId": "get--info", "parameters": [], "responses": { "200": { "description": "com.trifectalabs.roadquality.v0.models.versionInfo", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/versionInfo" } } }, "headers": {} } }, "tags": [ "versionInfo" ] } } }, "servers": [ {} ] }