Skip to content

Commit

Permalink
Workaround for HLS not finding files while running template haskell
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed May 12, 2022
1 parent 7f1ffb7 commit 84a8f6b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion services/brig/src/Brig/API/Public.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}

Expand Down Expand Up @@ -146,7 +147,11 @@ swaggerDocsAPI (Just V2) =
<> CannonAPI.swaggerDoc
)
& S.info . S.title .~ "Wire-Server API"
& S.info . S.description ?~ $(embedText "docs/swagger.md") <> mempty
#ifdef __GHCIDE__
& S.info . S.description ?~ $(embedText "services/brig/docs/swagger.md")
#else
& S.info . S.description ?~ $(embedText "docs/swagger.md")
#endif
& S.security %~ nub
-- sanitise definitions
& S.definitions . traverse %~ sanitise
Expand All @@ -170,12 +175,20 @@ swaggerDocsAPI (Just V0) =
swaggerSchemaUIServer
. fromMaybe Aeson.Null
. Aeson.decode
#ifdef __GHCIDE__
$ $(embedLazyByteString "services/brig/docs/swagger-v0.json")
#else
$ $(embedLazyByteString "docs/swagger-v0.json")
#endif
swaggerDocsAPI (Just V1) =
swaggerSchemaUIServer
. fromMaybe Aeson.Null
. Aeson.decode
#ifdef __GHCIDE__
$ $(embedLazyByteString "services/brig/docs/swagger-v1.json")
#else
$ $(embedLazyByteString "docs/swagger-v1.json")
#endif
swaggerDocsAPI Nothing = swaggerDocsAPI (Just maxBound)

servantSitemap :: ServerT BrigAPI (Handler r)
Expand Down

0 comments on commit 84a8f6b

Please sign in to comment.