aboutsummaryrefslogtreecommitdiff
path: root/lib/Persist.hs
diff options
context:
space:
mode:
authorstuebinm2022-09-11 00:50:43 +0200
committerstuebinm2022-09-11 00:50:43 +0200
commit30324fc535b73e18f576bb12fe3a421d404c19ff (patch)
tree9ee3edbc414d8a4ca03f38d04473b8f53e13613f /lib/Persist.hs
parent76303ad71e0d7e63cf34a68a81548cb791798f97 (diff)
correct the generated openapi description
Diffstat (limited to 'lib/Persist.hs')
-rw-r--r--lib/Persist.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Persist.hs b/lib/Persist.hs
index aa040cf..769db2a 100644
--- a/lib/Persist.hs
+++ b/lib/Persist.hs
@@ -87,7 +87,7 @@ TrainPing json sql=tt_trip_ping
lat Double
long Double
timestamp UTCTime
- deriving Show Generic Eq ToSchema
+ deriving Show Generic Eq
-- status of a train somewhen in time (may be in the future),
-- inferred from trainpings / entered via controlRoom
@@ -123,6 +123,8 @@ ScheduleAmendment json sql=tt_schedule_amendement
instance ToSchema RunningId where
declareNamedSchema _ = declareNamedSchema (Proxy @UUID)
+instance ToSchema TrainPing where
+ declareNamedSchema = genericDeclareNamedSchema (swaggerOptions "trainPing")
runSql :: MonadIO m => Pool SqlBackend -> ReaderT SqlBackend (NoLoggingT (ResourceT IO)) a -> m a
runSql pool = liftIO . flip runSqlPersistMPool pool