From cfd45d8a9e204f9777dbb927cc99f40ef6324df6 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 7 Jul 2022 00:09:19 +0200 Subject: don't have the ControlRoom API in Swagger just causes pain and isn't really useful for anything since it's a webform API meant to be used by the web frontend, not by other applications. --- lib/API.hs | 6 +----- lib/Server.hs | 4 ++-- lib/Server/ControlRoom.hs | 6 ------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/API.hs b/lib/API.hs index f95132a..e491812 100644 --- a/lib/API.hs +++ b/lib/API.hs @@ -47,7 +47,6 @@ type API = "stations" :> Get '[JSON] (Map StationID Station) :<|> "gtfs" :> GtfsRealtimeAPI -- TODO: this should be behind auth / OpenID or something :<|> "admin" :> AdminAPI - :<|> "control" :> ControlRoomAPI -- | The API used for publishing gtfs realtime updates type GtfsRealtimeAPI = "servicealerts" :> Get '[Proto] FeedMessage @@ -70,12 +69,9 @@ type AdminAPI = -- documented, which would be silly and way to verbose. type CompleteAPI = "debug" :> "openapi" :> Get '[JSON] Swagger :<|> API + :<|> "control" :> ControlRoomAPI - -instance ToParamSchema (Maybe UTCTime) where - toParamSchema _ = toParamSchema (Proxy @UTCTime) - -- TODO write something useful here! (and if it's just "hey this is some websocket thingie") instance HasSwagger WebSocket where toSwagger _ = toSwagger (Proxy @(Post '[JSON] NoContent)) diff --git a/lib/Server.hs b/lib/Server.hs index 539e3ce..544b6ae 100644 --- a/lib/Server.hs +++ b/lib/Server.hs @@ -61,10 +61,10 @@ doMigration pool = runSql pool $ runMigration migrateAll server :: GTFS -> Pool SqlBackend -> Service CompleteAPI -server gtfs@GTFS{..} dbpool = handleDebugAPI :<|> handleStations :<|> handleTimetable :<|> handleTrip +server gtfs@GTFS{..} dbpool = handleDebugAPI :<|> (handleStations :<|> handleTimetable :<|> handleTrip :<|> handleRegister :<|> handleTripPing :<|> handleWS :<|> handleDebugState :<|> gtfsRealtimeServer gtfs dbpool - :<|> adminServer gtfs dbpool + :<|> adminServer gtfs dbpool) :<|> controlRoomServer where handleStations = pure stations handleTimetable station maybeDay = do diff --git a/lib/Server/ControlRoom.hs b/lib/Server/ControlRoom.hs index 68d1437..c63b74b 100644 --- a/lib/Server/ControlRoom.hs +++ b/lib/Server/ControlRoom.hs @@ -130,9 +130,3 @@ genericToHtmlForm HtmlFormOptions{..} (Proxy :: Proxy a) = instance ToHtmlForm CalendarDate -instance ToSchema Form where - declareNamedSchema _ = undefined -instance ToSchema TripList where - declareNamedSchema _ = undefined -instance ToSchema CalendarDate where - declareNamedSchema _ = undefined -- cgit v1.2.3