openapi: 3.0.3 info: title: API specification for time travel estimation description: API specification for time travel estimation backend version: 1.0.1 paths: /journey: options: summary: CORS preflight request responses: "200": description: Successful preflight response headers: Access-Control-Allow-Origin: schema: type: string example: "*" Access-Control-Allow-Methods: schema: type: string example: "POST, OPTIONS" Access-Control-Allow-Headers: schema: type: string example: "Content-Type" post: summary: Compute travel route requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RouteRequest" example: start_coordinate: { lat: 1, lon: 2 } end_coordinate: { lat: 2, lon: 3 } timetype: DEPARTURE time: { hour: 10, minute: 10 } responses: "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/Route" "400": description: Bad request (invalid JSON, missing field, or missing body) content: text/plain: schema: type: string example: "Invalid JSON \n" "405": description: Method not allowed content: text/plain: schema: type: string example: "Method not allowed \n" "500": description: Internal server error content: text/plain: schema: type: string example: "Internal server error \n" components: schemas: Coordinate: type: object required: [lat, lon] properties: lat: type: number lon: type: number Time: type: object required: [hour, minute] properties: hour: type: integer minute: type: integer TimeType: type: string enum: [DEPARTURE, ARRIVAL] RouteRequest: type: object required: - start_coordinate - end_coordinate - timetype - time properties: start_coordinate: $ref: "#/components/schemas/Coordinate" end_coordinate: $ref: "#/components/schemas/Coordinate" timetype: $ref: "#/components/schemas/TimeType" time: $ref: "#/components/schemas/Time" LineString: type: object required: [type, coordinates] properties: type: type: string enum: [LineString] coordinates: type: array description: Array of [lat, lon] coordinate pairs items: type: array minItems: 2 maxItems: 2 items: type: number Route: type: object required: [linestring, traversalTime, length] properties: linestring: $ref: "#/components/schemas/LineString" traversalTime: type: number description: Estimated traversal time in seconds length: type: number description: Route length in kilometers