{"openapi":"3.1.0","info":{"title":"Travel Risk API","version":"1.0"},"servers":[{"url":"http://travel-risk-project-production.up.railway.app","description":"Generated server url"}],"security":[{"bearerAuth":[]}],"paths":{"/trips/{id}":{"get":{"tags":["trip-controller"],"operationId":"getTripById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Trip"}}}}}},"put":{"tags":["trip-controller"],"operationId":"updateTrip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTripRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Trip"}}}}}},"delete":{"tags":["trip-controller"],"operationId":"deleteTrip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}}}},"/trips":{"post":{"tags":["trip-controller"],"operationId":"createTrip","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Trip"}}}}}}},"/trips/flight":{"post":{"tags":["trip-controller"],"operationId":"createTripFromFlights","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlightTripRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Trip"}}}}}}},"/risk/evaluate":{"post":{"tags":["risk-controller"],"operationId":"getRisk","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskEvaluateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RiskEvaluateResponse"}}}}}}},"/auth/register":{"post":{"tags":["auth-controller"],"operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/logout":{"post":{"tags":["auth-controller"],"operationId":"logout","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/auth/login":{"post":{"tags":["auth-controller"],"operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/users/me":{"get":{"tags":["user-controller"],"operationId":"getCurrentUser","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/trips/user":{"get":{"tags":["trip-controller"],"operationId":"getUserTrips","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Trip"}}}}}}}},"/news/{tripId}":{"get":{"tags":["news-controller"],"operationId":"getTripNews","parameters":[{"name":"tripId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NewsArticle"}}}}}}}}},"components":{"schemas":{"UpdateTripRequest":{"type":"object","properties":{"departureAirport":{"type":"string"},"arrivalAirport":{"type":"string"},"layoverAirports":{"type":"array","items":{"type":"string"}},"departureDate":{"type":"string","format":"date"},"flightNumber":{"type":"array","items":{"type":"string"}}}},"Trip":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"departureAirport":{"type":"string"},"arrivalAirport":{"type":"string"},"departureDate":{"type":"string","format":"date"},"flightNumber":{"type":"array","items":{"type":"string"}},"layoverAirports":{"type":"array","items":{"type":"string"}},"user":{"$ref":"#/components/schemas/User"},"riskScore":{"type":"integer","format":"int32"},"riskLevel":{"type":"string","enum":["LEVEL_1_NORMAL","LEVEL_2_CAUTION","LEVEL_3_RECONSIDER","LEVEL_4_DO_NOT_TRAVEL"]},"factors":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"hashedPassword":{"type":"string"},"email":{"type":"string"}}},"CreateTripRequest":{"type":"object","properties":{"departureAirport":{"type":"string"},"arrivalAirport":{"type":"string"},"layoverAirports":{"type":"array","items":{"type":"string"}},"departureDate":{"type":"string","format":"date"},"flightNumber":{"type":"array","items":{"type":"string"}}}},"FlightTripRequest":{"type":"object","properties":{"flightNumbers":{"type":"array","items":{"type":"string"}},"departureDate":{"type":"string","format":"date"}}},"RiskEvaluateRequest":{"type":"object","properties":{"departureAirport":{"type":"string"},"arrivalAirport":{"type":"string"},"layoverAirports":{"type":"array","items":{"type":"string"}}}},"RiskEvaluateResponse":{"type":"object","properties":{"riskScore":{"type":"integer","format":"int32"},"riskLevel":{"type":"string","enum":["LEVEL_1_NORMAL","LEVEL_2_CAUTION","LEVEL_3_RECONSIDER","LEVEL_4_DO_NOT_TRAVEL"]},"factors":{"type":"array","items":{"type":"string"}}}},"RegisterRequest":{"type":"object","properties":{"email":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}}},"AuthResponse":{"type":"object","properties":{"username":{"type":"string"},"email":{"type":"string"},"userId":{"type":"integer","format":"int64"},"token":{"type":"string"}}},"LoginRequest":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"NewsArticle":{"type":"object","properties":{"author":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"source":{"$ref":"#/components/schemas/Source","writeOnly":true},"publishedAt":{"type":"string"},"sourceName":{"type":"string"}}},"Source":{"type":"object","properties":{"name":{"type":"string"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}}