Created by: f-f
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. -
Filed the PR against the correct branch: master
,3.4.x
,4.0.x
. Default:master
. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
Problem: the current haskell-servant
client is based on a set of libraries (lts
package set) from one year ago, based on the 8.0.x
release of GHC. It is typical for library writers in the Haskell community to maintain compatibility with the latest 3 major versions of the compiler. By this standard (since 8.2
, 8.4
and 8.6
are out) we are generating an outdated client. Moreover, the servant
library itself went through several breaking versions in the meanwhile, so the code generated by this generator is not really compatible with a project started today.
This PR upgrades to the latest lts
(12.18 for GHC 8.4) and servant
version, and adds several new features:
- optionals are now
Maybe
s -
UUID
,UTCTime
andDay
are now represented with the correct types - the configuration for the client now contains only one parameter, the
url
- add
ToSchema
instances to generated types, so they can be re-exposed for free in the spec of the service using the client - switch to the
tls-http-manager
, so we can connect to https urls - add Nix support in the
stack.yaml
- add a nicer API to call the endpoints
Note: all of this is quite breaking, so I opened the PR against the 4.x
branch
/cc @wing328