require stackage nightly, for newer pandoc/swagger
Move to a newer stackage snapshot. This helps ensure a new-enough pandoc will more be available for doc building without needing extra compilation. Also we get to use the latest swagger and servant-swagger for hledger-api, but we have to go to stackage nightly. With luck there will be a lts 6 before next hledger release.
This commit is contained in:
parent
df3cb6d334
commit
9439d1a611
@ -33,7 +33,7 @@ import Text.Printf
|
|||||||
import Hledger.Query
|
import Hledger.Query
|
||||||
import Hledger.Cli hiding (Reader, version)
|
import Hledger.Cli hiding (Reader, version)
|
||||||
|
|
||||||
version="0.27.98"
|
hledgerApiVersion="0.27.98"
|
||||||
|
|
||||||
-- https://github.com/docopt/docopt.hs#readme
|
-- https://github.com/docopt/docopt.hs#readme
|
||||||
doc :: Docopt
|
doc :: Docopt
|
||||||
@ -62,16 +62,16 @@ Options:
|
|||||||
|
|
||||||
swaggerSpec :: Swagger
|
swaggerSpec :: Swagger
|
||||||
swaggerSpec = toSwagger (Proxy :: Proxy HledgerApi)
|
swaggerSpec = toSwagger (Proxy :: Proxy HledgerApi)
|
||||||
& info.infoTitle .~ "hledger API"
|
& info.title .~ "hledger API"
|
||||||
& info.infoVersion .~ pack version
|
& info.version .~ pack hledgerApiVersion
|
||||||
& info.infoDescription .~ Just "This is the API provided by hledger-api for reading hledger data"
|
& info.description .~ Just "This is the API provided by hledger-api for reading hledger data"
|
||||||
& info.infoLicense .~ Just (License "GPLv3+" (Nothing))
|
& info.license .~ Just (License "GPLv3+" (Nothing))
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
args <- getArgs >>= parseArgsOrExit doc
|
args <- getArgs >>= parseArgsOrExit doc
|
||||||
when (isPresent args (longOption "help")) $ exitWithUsage doc
|
when (isPresent args (longOption "help")) $ exitWithUsage doc
|
||||||
when (isPresent args (longOption "version")) $ putStrLn version >> exitSuccess
|
when (isPresent args (longOption "version")) $ putStrLn hledgerApiVersion >> exitSuccess
|
||||||
when (isPresent args (longOption "swagger")) $ BL8.putStrLn (encode swaggerSpec) >> exitSuccess
|
when (isPresent args (longOption "swagger")) $ BL8.putStrLn (encode swaggerSpec) >> exitSuccess
|
||||||
let defp = "8001"
|
let defp = "8001"
|
||||||
p <- case readMay $ getArgWithDefault args defp (longOption "port") of
|
p <- case readMay $ getArgWithDefault args defp (longOption "port") of
|
||||||
@ -186,17 +186,15 @@ instance ToJSON Account where
|
|||||||
,"aparentname" .= toJSON (maybe "" aname $ aparent a)
|
,"aparentname" .= toJSON (maybe "" aname $ aparent a)
|
||||||
,"asubs" .= toJSON (map toJSON $ asubs a)
|
,"asubs" .= toJSON (map toJSON $ asubs a)
|
||||||
]
|
]
|
||||||
instance ToJSON AccountTransactionsReport where toJSON = genericToJSON defaultOptions
|
|
||||||
|
|
||||||
instance ToSchema ClearedStatus
|
instance ToSchema ClearedStatus
|
||||||
instance ToSchema GenericSourcePos
|
instance ToSchema GenericSourcePos
|
||||||
instance ToSchema Decimal
|
instance ToSchema Decimal
|
||||||
where
|
where
|
||||||
declareNamedSchema _proxy = pure (Just "Decimal", schema)
|
declareNamedSchema _proxy = pure $ NamedSchema (Just "Decimal") schema
|
||||||
where
|
where
|
||||||
schema = mempty
|
schema = mempty
|
||||||
& schemaType .~ SwaggerNumber
|
& type_ .~ SwaggerNumber
|
||||||
& schemaExample .~ Just (toJSON (100 :: Decimal))
|
& example .~ Just (toJSON (100 :: Decimal))
|
||||||
instance ToSchema Amount
|
instance ToSchema Amount
|
||||||
instance ToSchema AmountStyle
|
instance ToSchema AmountStyle
|
||||||
instance ToSchema Side
|
instance ToSchema Side
|
||||||
|
|||||||
@ -9,10 +9,12 @@ packages:
|
|||||||
|
|
||||||
#flags:
|
#flags:
|
||||||
|
|
||||||
resolver: lts-4.2 # or newer
|
# this or a newer snapshot is suggested
|
||||||
|
#resolver: lts-5.11
|
||||||
|
# hledger-api/servant/aeson requires > lts-5
|
||||||
|
resolver: nightly-2016-04-01
|
||||||
|
|
||||||
extra-deps:
|
#extra-deps:
|
||||||
- servant-swagger-0.1
|
|
||||||
|
|
||||||
# ghc-options:
|
# ghc-options:
|
||||||
# rtsopts:
|
# rtsopts:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user