From def355a7db4d937e85860395a6e9e09899ce5854 Mon Sep 17 00:00:00 2001 From: "W. Duncan Fraser" Date: Mon, 7 Dec 2020 18:06:00 -0600 Subject: [PATCH] Add operationId --- src/Servant/Swagger/Internal.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Servant/Swagger/Internal.hs b/src/Servant/Swagger/Internal.hs index 666636a9b..334056adc 100644 --- a/src/Servant/Swagger/Internal.hs +++ b/src/Servant/Swagger/Internal.hs @@ -318,6 +318,10 @@ instance (KnownSymbol desc, HasSwagger api) => HasSwagger (Description desc :> a toSwagger _ = toSwagger (Proxy :: Proxy api) & allOperations.description %~ (Just (Text.pack (symbolVal (Proxy :: Proxy desc))) <>) +instance (KnownSymbol opid, HasSwagger api) => HasSwagger (OperationId opid :> api) where + toSwagger _ = toSwagger (Proxy :: Proxy api) + & allOperations.operationId ?~ Text.pack (symbolVal (Proxy :: Proxy opid)) + instance (KnownSymbol desc, HasSwagger api) => HasSwagger (Summary desc :> api) where toSwagger _ = toSwagger (Proxy :: Proxy api) & allOperations.summary %~ (Just (Text.pack (symbolVal (Proxy :: Proxy desc))) <>)