Package maintainers and Hackage trustees are allowed to edit certain bits
of package metadata after a release, without uploading a new tarball.
Note that the tarball itself is never changed, just the metadata that is
stored separately. For more information about metadata revisions, please
refer to the
Hackage Metadata Revisions FAQ.
No. |
Time |
User |
SHA256 |
-r2 (servant-docs-0.2-r2) |
2017-12-10T22:36:11Z |
phadej |
f611775f251645facb1aabc914c28b7561e5298381f09a2a134e895054caa6cb
|
|
|
-r1 (servant-docs-0.2-r1) |
2014-12-09T14:46:13Z |
AlpMestanogullari |
d2cef7e1fc1e374f4a4b921b4d6958c61547a308e31942c813d1dc6fdbc6da51
|
|
Changed author
from Alp Mestanogullari, Sönke Hahn, Julian K. Arni
to Alp Mestanogullari, Sönke Hahn, Julian K. Arni Changed description
from Library for generating API docs from a servant API definition.
Runnable example below that prints API docs in markdown.
> {-# LANGUAGE DataKinds #-}
> {-# LANGUAGE PolyKinds #-}
> {-# LANGUAGE TypeFamilies #-}
> {-# LANGUAGE DeriveGeneric #-}
> {-# LANGUAGE TypeOperators #-}
> {-# LANGUAGE FlexibleInstances #-}
> {-# LANGUAGE OverloadedStrings #-}
>
> import Data.Proxy
> import Data.Text
> import Servant
>
> -- our type for a Greeting message
> data Greet = Greet { _msg :: Text }
> deriving (Generic, Show)
>
> -- we get our JSON serialization for free
> instance FromJSON Greet
> instance ToJSON Greet
>
> -- we provide a sample value for the 'Greet' type
> instance ToSample Greet where
> toSample = Just g
>
> where g = Greet "Hello, haskeller!"
>
> instance ToParam (QueryParam "capital" Bool) where
> toParam _ =
> DocQueryParam "capital"
> ["true", "false"]
> "Get the greeting message in uppercase (true) or not (false). Default is false."
>
> instance ToCapture (Capture "name" Text) where
> toCapture _ = DocCapture "name" "name of the person to greet"
>
> instance ToCapture (Capture "greetid" Text) where
> toCapture _ = DocCapture "greetid" "identifier of the greet msg to remove"
>
> -- API specification
> type TestApi =
> "hello" :> Capture "name" Text :> QueryParam "capital" Bool :> Get Greet
> :<|> "greet" :> RQBody Greet :> Post Greet
> :<|> "delete" :> Capture "greetid" Text :> Delete
>
> testApi :: Proxy TestApi
> testApi = Proxy
>
> -- Generate the Documentation's ADT
> greetDocs :: API
> greetDocs = docs testApi
>
> main :: IO ()
> main = putStrLn $ markdown greetDocs
to Library for generating API docs from a servant API definition.
Runnable example <https://github.com/haskell-servant/servant-docs/blob/master/example/greet.hs here> that prints API docs in markdown.
|
-r0 (servant-docs-0.2-r0) |
2014-12-09T14:37:29Z |
AlpMestanogullari |
26fa14aa5cf5985c2f910ca9e927b2f1275692f83e636d1c0c4967aa5c77fb9a
|
|
|