diff --git a/services/brig/brig.cabal b/services/brig/brig.cabal index 5785072b6fb..33e3de7687a 100644 --- a/services/brig/brig.cabal +++ b/services/brig/brig.cabal @@ -203,6 +203,7 @@ library , errors >=1.4 , exceptions >=0.5 , extended + , file-embed , file-embed-lzma , filepath >=1.3 , fsnotify >=0.2 diff --git a/services/brig/package.yaml b/services/brig/package.yaml index b187df72ad2..91c05a0b17c 100644 --- a/services/brig/package.yaml +++ b/services/brig/package.yaml @@ -48,6 +48,7 @@ library: - errors >=1.4 - exceptions >=0.5 - extended + - file-embed - file-embed-lzma - filepath >=1.3 - fsnotify >=0.2 diff --git a/services/brig/src/Brig/API/Public.hs b/services/brig/src/Brig/API/Public.hs index ff9fc9357cf..88efa357e9a 100644 --- a/services/brig/src/Brig/API/Public.hs +++ b/services/brig/src/Brig/API/Public.hs @@ -72,6 +72,7 @@ import qualified Data.ByteString.Lazy.Char8 as LBS import Data.CommaSeparatedList (CommaSeparatedList (fromCommaSeparatedList)) import Data.Containers.ListUtils (nubOrd) import Data.Domain +import Data.FileEmbed import Data.Handle (Handle, parseHandle) import Data.Id as Id import qualified Data.Map.Strict as Map @@ -146,7 +147,7 @@ swaggerDocsAPI (Just V2) = <> CannonAPI.swaggerDoc ) & S.info . S.title .~ "Wire-Server API" - & S.info . S.description ?~ $(embedText "docs/swagger.md") <> mempty + & S.info . S.description ?~ $(embedText =<< makeRelativeToProject "docs/swagger.md") & S.security %~ nub -- sanitise definitions & S.definitions . traverse %~ sanitise @@ -170,12 +171,12 @@ swaggerDocsAPI (Just V0) = swaggerSchemaUIServer . fromMaybe Aeson.Null . Aeson.decode - $ $(embedLazyByteString "docs/swagger-v0.json") + $ $(embedLazyByteString =<< makeRelativeToProject "docs/swagger-v0.json") swaggerDocsAPI (Just V1) = swaggerSchemaUIServer . fromMaybe Aeson.Null . Aeson.decode - $ $(embedLazyByteString "docs/swagger-v1.json") + $ $(embedLazyByteString =<< makeRelativeToProject "docs/swagger-v1.json") swaggerDocsAPI Nothing = swaggerDocsAPI (Just maxBound) servantSitemap :: ServerT BrigAPI (Handler r)