servant-docs 0.8.1 → 0.9
raw patch · 2 files changed
+4/−7 lines, 2 filesdep −bytestring-conversiondep ~servant
Dependencies removed: bytestring-conversion
Dependency ranges changed: servant
Files
- servant-docs.cabal +2/−4
- src/Servant/Docs/Internal.hs +2/−3
servant-docs.cabal view
@@ -1,5 +1,5 @@ name: servant-docs-version: 0.8.1+version: 0.9 synopsis: generate API docs for your servant webservice description: Library for generating API docs from a servant API definition.@@ -36,13 +36,12 @@ , aeson , aeson-pretty , bytestring- , bytestring-conversion , case-insensitive , hashable , http-media >= 0.6 , http-types >= 0.7 , lens- , servant == 0.8.*+ , servant == 0.9.* , string-conversions , text , unordered-containers@@ -61,7 +60,6 @@ build-depends: base , aeson- , bytestring-conversion , lens , servant , servant-docs
src/Servant/Docs/Internal.hs view
@@ -25,7 +25,6 @@ import Control.Lens (makeLenses, mapped, over, traversed, view, (%~), (&), (.~), (<>~), (^.), (|>)) import qualified Control.Monad.Omega as Omega-import Data.ByteString.Conversion (ToByteString, toByteString) import Data.ByteString.Lazy.Char8 (ByteString) import qualified Data.ByteString.Char8 as BSC import qualified Data.CaseInsensitive as CI@@ -461,12 +460,12 @@ instance AllHeaderSamples '[] where allHeaderToSample _ = [] -instance (ToByteString l, AllHeaderSamples ls, ToSample l, KnownSymbol h)+instance (ToHttpApiData l, AllHeaderSamples ls, ToSample l, KnownSymbol h) => AllHeaderSamples (Header h l ': ls) where allHeaderToSample _ = mkHeader (toSample (Proxy :: Proxy l)) : allHeaderToSample (Proxy :: Proxy ls) where headerName = CI.mk . cs $ symbolVal (Proxy :: Proxy h)- mkHeader (Just x) = (headerName, cs $ toByteString x)+ mkHeader (Just x) = (headerName, cs $ toHeader x) mkHeader Nothing = (headerName, "<no header sample provided>") -- | Synthesise a sample value of a type, encoded in the specified media types.