commit ghc-servant-docs for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-servant-docs for openSUSE:Factory checked in at 2017-08-31 20:59:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-servant-docs (Old) and /work/SRC/openSUSE:Factory/.ghc-servant-docs.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-servant-docs" Thu Aug 31 20:59:16 2017 rev:2 rq:513486 version:0.10.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-servant-docs/ghc-servant-docs.changes 2017-05-10 20:51:43.656602084 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-servant-docs.new/ghc-servant-docs.changes 2017-08-31 20:59:19.287323415 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:07:41 UTC 2017 - psimons@suse.com + +- Update to version 0.10.0.1. + +------------------------------------------------------------------- Old: ---- servant-docs-0.9.1.1.tar.gz New: ---- servant-docs-0.10.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-servant-docs.spec ++++++ --- /var/tmp/diff_new_pack.kvv5fn/_old 2017-08-31 20:59:20.363172255 +0200 +++ /var/tmp/diff_new_pack.kvv5fn/_new 2017-08-31 20:59:20.363172255 +0200 @@ -19,7 +19,7 @@ %global pkg_name servant-docs %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.9.1.1 +Version: 0.10.0.1 Release: 0 Summary: Generate API docs for your servant webservice License: BSD-3-Clause @@ -30,6 +30,7 @@ BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-aeson-pretty-devel +BuildRequires: ghc-base-compat-devel BuildRequires: ghc-bytestring-devel BuildRequires: ghc-case-insensitive-devel BuildRequires: ghc-control-monad-omega-devel ++++++ servant-docs-0.9.1.1.tar.gz -> servant-docs-0.10.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-docs-0.9.1.1/CHANGELOG.md new/servant-docs-0.10.0.1/CHANGELOG.md --- old/servant-docs-0.9.1.1/CHANGELOG.md 2016-10-24 17:04:42.000000000 +0200 +++ new/servant-docs-0.10.0.1/CHANGELOG.md 2017-05-24 09:22:49.000000000 +0200 @@ -1,3 +1,8 @@ +0.10 +---- + +There are no changes. Released as a part of `servant` suite. + 0.7.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-docs-0.9.1.1/README.md new/servant-docs-0.10.0.1/README.md --- old/servant-docs-0.9.1.1/README.md 2016-10-24 17:04:42.000000000 +0200 +++ new/servant-docs-0.10.0.1/README.md 2017-05-24 09:22:49.000000000 +0200 @@ -19,7 +19,7 @@ import Data.Proxy import Data.Text -import Servant +import Servant.Docs -- our type for a Greeting message data Greet = Greet { _msg :: Text } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-docs-0.9.1.1/servant-docs.cabal new/servant-docs-0.10.0.1/servant-docs.cabal --- old/servant-docs-0.9.1.1/servant-docs.cabal 2016-10-27 13:25:27.000000000 +0200 +++ new/servant-docs-0.10.0.1/servant-docs.cabal 2017-05-24 09:22:49.000000000 +0200 @@ -1,5 +1,5 @@ name: servant-docs -version: 0.9.1.1 +version: 0.10.0.1 synopsis: generate API docs for your servant webservice description: Library for generating API docs from a servant API definition. @@ -12,7 +12,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, Servant Contributors -category: Web +category: Servant Web build-type: Simple cabal-version: >=1.10 tested-with: GHC >= 7.8 @@ -33,6 +33,7 @@ , Servant.Docs.Internal.Pretty build-depends: base >=4.7 && <5 + , base-compat >= 0.9.1 && <0.10 , aeson , aeson-pretty , bytestring @@ -41,11 +42,14 @@ , http-media >= 0.6 , http-types >= 0.7 , lens - , servant == 0.9.* + , servant == 0.11.* , string-conversions , text , unordered-containers , control-monad-omega == 0.3.* + if !impl(ghc >= 8.0) + build-depends: + semigroups >=0.16.2.2 && <0.19 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-docs-0.9.1.1/src/Servant/Docs/Internal.hs new/servant-docs-0.10.0.1/src/Servant/Docs/Internal.hs --- old/servant-docs-0.9.1.1/src/Servant/Docs/Internal.hs 2016-10-24 17:04:42.000000000 +0200 +++ new/servant-docs-0.10.0.1/src/Servant/Docs/Internal.hs 2017-05-24 09:22:49.000000000 +0200 @@ -20,6 +20,8 @@ #include "overlapping-compat.h" module Servant.Docs.Internal where +import Prelude () +import Prelude.Compat import Control.Applicative import Control.Arrow (second) import Control.Lens (makeLenses, mapped, over, traversed, view, (%~), @@ -30,19 +32,19 @@ import qualified Data.CaseInsensitive as CI import Data.Hashable (Hashable) import Data.HashMap.Strict (HashMap) -import Data.List +import Data.List.Compat (intercalate, intersperse, sort) import Data.Maybe -import Data.Monoid +import Data.Monoid (All (..), Any (..), Sum (..), Product (..), First (..), Last (..), Dual (..)) +import Data.Semigroup (Semigroup (..)) import Data.Ord (comparing) import Data.Proxy (Proxy(Proxy)) import Data.String.Conversions (cs) import Data.Text (Text, unpack) -import GHC.Exts (Constraint) import GHC.Generics import GHC.TypeLits import Servant.API import Servant.API.ContentTypes -import Servant.Utils.Links +import Servant.API.TypeLevel import qualified Data.HashMap.Strict as HM import qualified Data.Text as T @@ -103,8 +105,11 @@ , _apiEndpoints :: HashMap Endpoint Action } deriving (Eq, Show) +instance Semigroup API where + (<>) = mappend + instance Monoid API where - API a1 b1 `mappend` API a2 b2 = API (a1 <> a2) (b1 <> b2) + API a1 b1 `mappend` API a2 b2 = API (a1 `mappend` a2) (b1 `mappend` b2) mempty = API mempty mempty -- | An empty 'API' @@ -163,6 +168,8 @@ -- These are intended to be built using extraInfo. -- Multiple ExtraInfo may be combined with the monoid instance. newtype ExtraInfo api = ExtraInfo (HashMap Endpoint Action) +instance Semigroup (ExtraInfo a) where + (<>) = mappend instance Monoid (ExtraInfo a) where mempty = ExtraInfo mempty ExtraInfo a `mappend` ExtraInfo b = @@ -242,7 +249,7 @@ , _notes :: [DocNote] -- user supplied , _mxParams :: [(String, [DocQueryParam])] -- type collected + user supplied info , _rqtypes :: [M.MediaType] -- type collected - , _rqbody :: [(M.MediaType, ByteString)] -- user supplied + , _rqbody :: [(Text, M.MediaType, ByteString)] -- user supplied , _response :: Response -- user supplied } deriving (Eq, Ord, Show) @@ -306,15 +313,6 @@ docsWithOptions :: HasDocs api => Proxy api -> DocOptions -> API docsWithOptions p = docsFor p (defEndpoint, defAction) --- | Closed type family, check if endpoint is exactly within API. - --- We aren't sure what affects how an Endpoint is built up, so we require an --- exact match. -type family IsIn (endpoint :: *) (api :: *) :: Constraint where - IsIn e (sa :<|> sb) = Or (IsIn e sa) (IsIn e sb) - IsIn (e :> sa) (e :> sb) = IsIn sa sb - IsIn e e = () - -- | Create an 'ExtraInfo' that is guaranteed to be within the given API layout. -- -- The safety here is to ensure that you only add custom documentation to an @@ -620,7 +618,7 @@ where values = param ^. paramValues - rqbodyStr :: [M.MediaType] -> [(M.MediaType, ByteString)]-> [String] + rqbodyStr :: [M.MediaType] -> [(Text, M.MediaType, ByteString)]-> [String] rqbodyStr [] [] = [] rqbodyStr types s = ["#### Request:", ""] @@ -632,8 +630,8 @@ <> map (\t -> " - `" <> show t <> "`") ts <> [""] - formatBody (m, b) = - "- Example: `" <> cs (show m) <> "`" : + formatBody (t, m, b) = + "- Example (" <> cs t <> "): `" <> cs (show m) <> "`" : contentStr m b markdownForType mime_type = @@ -685,6 +683,10 @@ p2 :: Proxy b p2 = Proxy +-- | The generated docs for @'EmptyAPI'@ are empty. +instance HasDocs EmptyAPI where + docsFor Proxy _ _ = emptyAPI + -- | @"books" :> 'Capture' "isbn" Text@ will appear as -- @/books/:isbn@ in the docs. instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api) @@ -803,11 +805,12 @@ instance (ToSample a, AllMimeRender (ct ': cts) a, HasDocs api) => HasDocs (ReqBody (ct ': cts) a :> api) where - docsFor Proxy (endpoint, action) = - docsFor subApiP (endpoint, action') + docsFor Proxy (endpoint, action) opts@DocOptions{..} = + docsFor subApiP (endpoint, action') opts where subApiP = Proxy :: Proxy api - action' = action & rqbody .~ sampleByteString t p + action' :: Action + action' = action & rqbody .~ take _maxSamples (sampleByteStrings t p) & rqtypes .~ allMime t t = Proxy :: Proxy (ct ': cts) p = Proxy :: Proxy a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-docs-0.9.1.1/test/Servant/DocsSpec.hs new/servant-docs-0.10.0.1/test/Servant/DocsSpec.hs --- old/servant-docs-0.9.1.1/test/Servant/DocsSpec.hs 2016-10-24 17:04:42.000000000 +0200 +++ new/servant-docs-0.10.0.1/test/Servant/DocsSpec.hs 2017-05-24 09:22:49.000000000 +0200 @@ -104,6 +104,9 @@ it "contains request body samples" $ md `shouldContain` "17" + it "does not generate any docs mentioning the 'empty-api' path" $ + md `shouldNotContain` "empty-api" + -- * APIs @@ -128,6 +131,7 @@ type TestApi1 = Get '[JSON, PlainText] (Headers '[Header "Location" String] Int) :<|> ReqBody '[JSON] String :> Post '[JSON] Datatype1 :<|> Header "X-Test" Int :> Put '[JSON] Int + :<|> "empty-api" :> EmptyAPI data TT = TT1 | TT2 deriving (Show, Eq) data UT = UT1 | UT2 deriving (Show, Eq)
participants (1)
-
root@hilbert.suse.de