{
    "openapi": "3.1.2",
    "info": {
        "title": "Maize Bus Backend",
        "version": ""
    },
    "components": {
        "schemas": {
            "Token": {
                "type": "string"
            },
            "Reminder": {
                "type": "object",
                "properties": {
                    "stpid": {
                        "type": "string"
                    },
                    "rtid": {
                        "type": "string"
                    },
                    "thresh": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "eta": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "stpid",
                    "rtid",
                    "thresh",
                    "eta"
                ],
                "additionalProperties": false
            },
            "FloorPlanVisuals": {
                "type": "object",
                "properties": {
                    "points": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Point"
                        }
                    },
                    "areas": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Area"
                        }
                    },
                    "boundingBox": {
                        "type": "object",
                        "properties": {
                            "sw": {
                                "$ref": "#/components/schemas/LatLon"
                            },
                            "ne": {
                                "$ref": "#/components/schemas/LatLon"
                            }
                        },
                        "required": [
                            "sw",
                            "ne"
                        ],
                        "additionalProperties": false
                    }
                },
                "required": [
                    "points",
                    "areas",
                    "boundingBox"
                ],
                "additionalProperties": false
            },
            "Point": {
                "type": "object",
                "properties": {
                    "x": {
                        "type": "number"
                    },
                    "y": {
                        "type": "number"
                    }
                },
                "required": [
                    "x",
                    "y"
                ],
                "additionalProperties": false,
                "description": "increasing `x` represents going northward, increasing `y` represents going eastward"
            },
            "Area": {
                "type": "object",
                "properties": {
                    "polygon": {
                        "type": "array",
                        "items": {
                            "type": "number"
                        },
                        "description": "indexes into `points`, adjacent points (1st and last included) have an edge between them"
                    },
                    "classification": {
                        "type": "string",
                        "enum": [
                            "hallway",
                            "classroom",
                            "bathroom",
                            "stairway",
                            "elevator"
                        ]
                    },
                    "label": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "text"
                                    },
                                    "value": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "type",
                                    "value"
                                ],
                                "additionalProperties": false
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "icon"
                                    },
                                    "of": {
                                        "type": "string",
                                        "enum": [
                                            "bathroomWomen",
                                            "bathroomMen",
                                            "bathroomNeutral",
                                            "information",
                                            "food",
                                            "stairs",
                                            "escalator",
                                            "elevator"
                                        ]
                                    }
                                },
                                "required": [
                                    "type",
                                    "of"
                                ],
                                "additionalProperties": false
                            }
                        ]
                    },
                    "labelPos": {
                        "$ref": "#/components/schemas/Point"
                    },
                    "doors": {
                        "type": "array",
                        "items": {
                            "type": "number"
                        },
                        "description": "indexes into `polygon`, orientation determined by neighboring edges"
                    }
                },
                "required": [
                    "polygon",
                    "classification",
                    "label",
                    "labelPos",
                    "doors"
                ],
                "additionalProperties": false
            },
            "LatLon": {
                "type": "object",
                "properties": {
                    "lon": {
                        "type": "number"
                    },
                    "lat": {
                        "type": "number"
                    }
                },
                "required": [
                    "lon",
                    "lat"
                ],
                "additionalProperties": false
            }
        }
    },
    "paths": {
        "/mbus/api/v3/plan-journey": {
            "get": {
                "summary": "",
                "description": "Plans a journey between origin and destination coordinates.",
                "parameters": [
                    {
                        "name": "originLat",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "originLon",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "destLat",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "destLon",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "walkingPenalty",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "range",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                }
            }
        },
        "/mbus/api/v3/setReminder": {
            "post": {
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "token": {
                                        "type": "string"
                                    },
                                    "stpid": {
                                        "type": "string"
                                    },
                                    "rtid": {
                                        "type": "string"
                                    },
                                    "thresh": {
                                        "type": "number"
                                    }
                                },
                                "required": [
                                    "token",
                                    "stpid",
                                    "rtid",
                                    "thresh"
                                ],
                                "additionalProperties": false
                            }
                        }
                    },
                    "required": true
                },
                "summary": "",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "success"
                    }
                }
            }
        },
        "/mbus/api/v3/activeReminders/{token}": {
            "get": {
                "summary": "active reminders",
                "description": "big long description idk, gets the reminders associated with a **registration token**, which is gotten from fcm or smth",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "reminders": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Reminder"
                                            }
                                        }
                                    },
                                    "required": [
                                        "reminders"
                                    ],
                                    "additionalProperties": false
                                }
                            }
                        }
                    }
                }
            }
        },
        "/mbus/api/v3/indoor/visuals": {
            "get": {
                "summary": "",
                "description": "",
                "parameters": [
                    {
                        "name": "buildingId",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "floor",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "points": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Point"
                                            }
                                        },
                                        "areas": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Area"
                                            }
                                        },
                                        "boundingBox": {
                                            "type": "object",
                                            "properties": {
                                                "sw": {
                                                    "$ref": "#/components/schemas/LatLon"
                                                },
                                                "ne": {
                                                    "$ref": "#/components/schemas/LatLon"
                                                }
                                            },
                                            "required": [
                                                "sw",
                                                "ne"
                                            ],
                                            "additionalProperties": false
                                        }
                                    },
                                    "required": [
                                        "points",
                                        "areas",
                                        "boundingBox"
                                    ],
                                    "additionalProperties": false
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}