diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
 See also the hledger and the project change logs.
 
 
+# 1.4 (2017/9/30)
+
+* api: add support for swagger2 2.1.5+ (fixes #612)
+
+
 # 1.3.1 (2017/8/25)
 
 * require servant-server 0.10+ to fix compilation warning
diff --git a/doc/hledger-api.1 b/doc/hledger-api.1
--- a/doc/hledger-api.1
+++ b/doc/hledger-api.1
@@ -1,5 +1,5 @@
 
-.TH "hledger\-api" "1" "August 2017" "hledger\-api 1.3.1" "hledger User Manuals"
+.TH "hledger\-api" "1" "September 2017" "hledger\-api 1.4" "hledger User Manuals"
 
 
 
@@ -79,23 +79,8 @@
 .RS
 .RE
 .TP
-.B \f[C]\-h\f[]
+.B \f[C]\-h\ \-\-help\f[]
 show usage
-.RS
-.RE
-.TP
-.B \f[C]\-\-help\f[]
-show manual as plain text
-.RS
-.RE
-.TP
-.B \f[C]\-\-man\f[]
-show manual with man
-.RS
-.RE
-.TP
-.B \f[C]\-\-info\f[]
-show manual with info
 .RS
 .RE
 .SH ENVIRONMENT
diff --git a/doc/hledger-api.1.info b/doc/hledger-api.1.info
--- a/doc/hledger-api.1.info
+++ b/doc/hledger-api.1.info
@@ -3,8 +3,8 @@
 
 File: hledger-api.1.info,  Node: Top,  Next: OPTIONS,  Up: (dir)
 
-hledger-api(1) hledger-api 1.3.1
-********************************
+hledger-api(1) hledger-api 1.4
+******************************
 
 hledger-api is a simple web API server, intended to support client-side
 web apps operating on hledger data.  It comes with a series of simple
@@ -57,23 +57,14 @@
 '--version'
 
      show version
-'-h'
+'-h --help'
 
      show usage
-'--help'
 
-     show manual as plain text
-'--man'
-
-     show manual with man
-'--info'
-
-     show manual with info
-
 
 Tag Table:
 Node: Top74
-Node: OPTIONS1224
-Ref: #options1311
+Node: OPTIONS1220
+Ref: #options1307
 
 End Tag Table
diff --git a/doc/hledger-api.1.txt b/doc/hledger-api.1.txt
--- a/doc/hledger-api.1.txt
+++ b/doc/hledger-api.1.txt
@@ -59,13 +59,8 @@
        --version
               show version
 
-       -h     show usage
-
-       --help show manual as plain text
-
-       --man  show manual with man
-
-       --info show manual with info
+       -h --help
+              show usage
 
 ENVIRONMENT
        LEDGER_FILE The journal file path when not specified with -f.  Default:
@@ -107,4 +102,4 @@
 
 
 
-hledger-api 1.3.1                 August 2017                   hledger-api(1)
+hledger-api 1.4                 September 2017                  hledger-api(1)
diff --git a/hledger-api.cabal b/hledger-api.cabal
--- a/hledger-api.cabal
+++ b/hledger-api.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           hledger-api
-version:        1.3.1
+version:        1.4
 synopsis:       Web API server for the hledger accounting tool
 description:    This is a simple web API server for hledger data.
                 It comes with a series of simple client-side web app examples.
@@ -22,7 +22,7 @@
 maintainer:     Simon Michael <simon@joyful.com>
 license:        GPL-3
 license-file:   LICENSE
-tested-with:    GHC==7.10.3, GHC==8.0
+tested-with:    GHC==7.10.3, GHC==8.0.2, GHC==8.2.1
 build-type:     Simple
 cabal-version:  >= 1.10
 
@@ -44,10 +44,10 @@
 executable hledger-api
   main-is: hledger-api.hs
   ghc-options: -threaded
-  cpp-options: -DVERSION="1.3.1"
+  cpp-options: -DVERSION="1.4"
   build-depends:
-      hledger-lib >= 1.3.1 && < 1.4
-    , hledger >= 1.3.1 && < 1.4
+      hledger-lib >= 1.4 && < 1.5
+    , hledger >= 1.4 && < 1.5
     , base >=4.8 && <5
     , aeson
     , bytestring
@@ -60,7 +60,7 @@
     , safe
     , servant-server >= 0.10
     , servant-swagger
-    , swagger2
+    , swagger2 >= 2.0 && < 2.2
     , text
     , transformers
     , wai
diff --git a/hledger-api.hs b/hledger-api.hs
--- a/hledger-api.hs
+++ b/hledger-api.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP                 #-}
 {-# LANGUAGE DataKinds           #-}
 {-# LANGUAGE DeriveGeneric       #-}
 {-# LANGUAGE OverloadedStrings   #-}
@@ -35,12 +36,12 @@
 import Hledger.Query
 import Hledger.Cli hiding (Reader, version)
 
-hledgerApiVersion="1.3.1"
+hledgerApiVersion="1.4"
 
 -- https://github.com/docopt/docopt.hs#readme
 doc :: Docopt
 doc = [docopt|
-hledger-api 1.3.1
+hledger-api 1.4
 
 Serves hledger data and reports as a JSON web API.
 
@@ -50,7 +51,7 @@
   hledger-api --swagger
     print API docs in Swagger 2.0 format
   hledger-api --version
-  hledger-api -h|--help|--man|--info
+  hledger-api -h|--help
 
 Options:
   -f --file FILE   use a different input file
@@ -60,10 +61,7 @@
      --host IPADDR listen on this IP address (default: 127.0.0.1)
   -p --port PORT   listen on this TCP port (default: 8001)
      --version     show version
-  -h               show usage
-     --help        show manual
-     --man         show manual with man
-     --info        show manual with info
+  -h --help        show usage
 |]
 
 swaggerSpec :: Swagger
@@ -76,11 +74,8 @@
 main :: IO ()
 main = do
   args <- getArgs >>= parseArgsOrExit doc
-  when (isPresent args (shortOption 'h')) $ exitWithUsage doc
-  when (isPresent args (longOption "help")) $ printHelpForTopic "api" >> exitSuccess
-  when (isPresent args (longOption "man"))  $ runManForTopic "api" >> exitSuccess
-  when (isPresent args (longOption "info")) $ runInfoForTopic "api" >> exitSuccess
-  when (isPresent args (longOption "version")) $ putStrLn hledgerApiVersion >> exitSuccess
+  when (isPresent args (shortOption 'h') || isPresent args (longOption "help")) $ exitWithUsage doc
+  when (isPresent args (longOption "version")) $ putStrLn ("hledger-api " ++ hledgerApiVersion) >> exitSuccess
   when (isPresent args (longOption "swagger")) $ BL8.putStrLn (encode swaggerSpec) >> exitSuccess
   let
     defh = "127.0.0.1"
@@ -218,6 +213,9 @@
 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
