Documentation and client generation from rest definition.

Version on this page:
LTS Haskell 10.10:
Stackage Nightly 2017-12-24:
Latest on Hackage:

See all snapshots rest-gen appears in

BSD-3-Clause licensed
Maintained by
This version can be pinned in stack with:rest-gen-,2365

Documentation and client generation from rest definition.



  • Allow semigroups 0.16.*

  • JavaScript: Add support for webpack (and any other preprocessor that tries to import all require function calls)

  • Haskell: Fixes a bug where client generation for end points without defined output or errors would default to parsing errors as XML even though the accept header was text/json. It now parses the response as json.


  • When instantiating API object you can now optionally pass a modifyRequest argument of type RequestObject -> RequestObject which is called before every request.

  • NodeJS: The cookieJar instance member is no longer available on sub resources, it can now only be accessed from the top-level api object. This is a breaking change for generated clients. It was a bad idea to use this to begin with since the cookie jar is shared across the entire api object.

  • JavaScript: Minor simplification in the template.

  • JavaScript/node.js: Each instance of a client now uses its own cookie jar automatically. You no longer need to depend on the request library to use generated clients. If you want access to the cookie jar use api.cookieJar.

  • Allow haskell-src-exts 1.16.*

  • Fix a bug where the generated Haskell client for a resource with a name that was a Haskell keyword would contain invalid code.
  • Relax bounds on semigroups.


You don’t have to regenerate clients for this release, but it is strongly recommended!

  • Accept headers are now sent based on both the output and errors of an endpoint, previously none of the clients would handle an end point with different inputs and outputs properly.

  • JavaScript/node.js: Error objects now contain a JSON response property if the error response is valid JSON.

  • Bump rest-types and rest-core

  • Allow json-schema 0.7.*

  • JavaScript/node.js: Fixed error handling for ECONNREFUSED and other “top level” errors


  • JavaScript/node.js: Clients now use and require Q promises
  • JavaScript/web: Will now use Q if available, and otherwise return the normal jQuery objects


  • JavaScript: Fix propagation of URLs to secure end points


  • Generated JavaScript now also works as a Node module
  • JavaScript constructors are now named properly instead of “constrWrapper”
  • Now generates valid Ruby code again


  • Expose modules Rest.Gen.Base.ActionInfo and Rest.Gen.Base.ApiTree again.
  • Make test cases compile again.
  • Allow Cabal == 1.16.*


  • Abstracted generated code into rest-client, you should regenerate haskell clients
  • haskell code generation is now done using haskell-src-exts
  • When using module name rewrites their qualification are now also rewritten.
  • Add hs-source-dirs and build-depends when generating cabal files
  • Moved Rest.Gen.Docs.Happstack to rest-happstack:Rest.Driver.Happstack.Docs
  • Expose Rest.Gen.Base
  • Flattened module hierarchy, Rest.Gen.Haskell.Generate is now Rest.Gen.Haskell etc.

  • Use json-schema 0.5.* and add showExample cases for Map and Any

  • Allow attoparsec 0.12.*


  • Derive Eq, Show for all types in Rest.Gen.Types
  • Haskell: Nub generated imports


Breaking changes:

  • Un-exposes internal modules so we don’t have to major bump on every change.
  • gen Now accepts AST-like types instead of just strings to make it more obvious how to use it, see types in Rest.Gen.Types


  • Make sure Identifiers are always imported when needed. This is a further improvement on the bugfix in rest-gen-0.11.
  • rest-gen-0.12 did not always take arguments in generated methods into account, so the renamed qualification has been reverted for now.


  • Haskell: Module rewrites such as Data.Text.Internal -> Data.Text now produces qualified imports import qualified Data.Text as Data.Text instead of import qualified Data.Text as Data.Text.Lazy. This prevents building against different versions of the same package that may have moved the internal module (as is the case with text) from generating different clients.


  • Bugfix: Haskell: Resources without a getter now generate identifier arguments for other end points
  • Shuffles some internal (but exposed) functions around

  • Drops aeson-utils dependency in favor of scientific >= 0.3.2

  • Allow mtl == 2.2.*

  • Bump Cabal upper bound to < 1.22


  • Generate documentation, Javascript and Haskell code for multi-delete handlers. The name of the generated functions is removeMany or removeManyBy<id>.
  • Escape reserved names in Haskell code generation.