api: add support for swagger2 2.1.5+ (fixes #612)

This commit is contained in:
Simon Michael 2017-09-22 08:21:11 -10:00
parent 0b7a50d0f0
commit 4be996ba89
3 changed files with 6 additions and 2 deletions

View File

@ -60,7 +60,7 @@ executable hledger-api
, safe
, servant-server >= 0.10
, servant-swagger
, swagger2 >= 2.0 && < 2.1.5
, swagger2 >= 2.0 && < 2.2
, text
, transformers
, wai

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
@ -212,6 +213,9 @@ instance ToSchema Side
instance ToSchema DigitGroupStyle
instance ToSchema MixedAmount
instance ToSchema Price
#if MIN_VERSION_swagger2(2,1,5)
where declareNamedSchema = genericDeclareNamedSchemaUnrestricted defaultSchemaOptions
#endif
instance ToSchema MarketPrice
instance ToSchema PostingType
instance ToSchema Posting

View File

@ -46,7 +46,7 @@ dependencies:
- safe
- servant-server >= 0.10
- servant-swagger
- swagger2 >= 2.0 && < 2.1.5
- swagger2 >= 2.0 && < 2.2
- text
- transformers
- wai