Commit Graph

43 Commits

Author SHA1 Message Date
Julian K. Arni
4824fbd961 Bump exceptions upper bound. 2018-03-13 11:07:44 +01:00
Oleg Grenrus
0ae673583b Bump lower bounds in servant
- `text` is already 1.2.3.0 as https://github.com/fpco/stackage/issues/3147
  is resolved AFAICS

- `http-types` bound is surprisingly low due:
  https://github.com/fpco/stackage/issues/2976
2018-01-25 15:06:14 +02:00
Oleg Grenrus
bc3f61d615 Add Servant.API.Modifiers to servant
Changes Header, ReqBody and QueryParam to take a modifier list.

Resolves https://github.com/haskell-servant/servant/issues/856

ResponseHeader story turns to be somewhat ugly, but it can be made
elegant when https://github.com/haskell-servant/servant/issues/841 is
implemnted, then we can omit HList aka Header Heterogenous List
implementation.

- servant-server changes:

  Writing server side intepretations is quite simple using
  `unfoldRequestArgument`, which makes Header and QueryParam look quite
  the same.

  `ReqBody` cannot be easily made optional with current design (what that
  would mean: No Content-Type Header?), so that dimensions isn't used
  there.

- Add HasLink for all the rest ComprehensiveAPI combinators
- Add 'tricky' Header', QueryParam' endpoints to ComprehensiveAPI
- servant-docs: Quick'n'dirty implementation. Don't use modifiers information (yet).
2018-01-25 09:10:11 +02:00
Michael Sloan
7e0ad51b62 Use (a :: *) on phantom type variables for kinder type checking #887 2018-01-17 21:16:21 -08:00
Robert Hensing
7410b4faa8 Links: add allLinks function and MkLink instance for (:<|>)
This lets you generate all links at once, which is useful in
conjunction with servant-generic.
2017-11-07 18:39:02 +02:00
Oleg Grenrus
15cc4f55dd Update docs related to hoistServer 2017-10-01 20:24:22 +03:00
Oleg Grenrus
b6cfd64b5a GHC-8.2 readyness 2017-05-24 08:02:57 +03:00
David Turner
7d07db7ed3 Add test for safeLink applied to an EmptyAPI type 2017-05-16 16:25:01 +00:00
Oleg Grenrus
6fff76e304 Add regression test for #734 2017-05-15 19:45:14 +03:00
Oleg Grenrus
df0755c557 Workaround TypeError doctest failures 2017-04-23 21:41:39 +03:00
Oleg Grenrus
7793b52d23 Change JSON content type to add the charset 2017-01-18 13:40:18 +02:00
Oleg Grenrus
d5e73bf577 Make servant buildable with cabal new-build 2017-01-16 11:03:06 +02:00
Oleg Grenrus
2b12436d3b Fix tests (URI -> Link) 2017-01-16 10:47:22 +02:00
Oleg Grenrus
4d4bc8e9f4 Pass contentType to the mimeUnrender variant 2017-01-01 20:05:12 +02:00
Oleg Grenrus
da55698fad Add multiple mimetypes tests 2016-11-10 21:22:01 +02:00
Julian K. Arni
ed82056052 Add noHeader function.
Which allows not adding a header where a signature declares one, making
    response headers optional.
2016-10-21 14:36:14 +02:00
Julian K. Arni
0870b3b2f5 Remove FromFormUrlEncoded and ToFormUrlEncoded.
In favor of FromForm and ToForm from the new version of http-api-data.
2016-09-12 18:34:18 -03:00
Jonathan Lange
a616a8d689 Add CaptureAll to the API definitions 2016-07-11 14:46:31 +01:00
Arian van Putten
05379ed7e3 Replace all occurances of () with NoContent
We use NoContent to signify an empty response nowadays. This commit
replaces all occurences of () with NoContent so that all packages use
the new semantics.
2016-07-10 16:58:59 +02:00
Sönke Hahn
3c27ff5a32 added test script for stack files (and fixed stack for ghc-7.8) 2016-05-29 00:03:46 +08:00
Oleg Grenrus
fd19694ed5 Make doctests accept GHC-8.0 formatted type errors 2016-05-10 19:09:59 +03:00
Sergei Trofimovich
c064f94fd6 Fix doctests failure when testpack or checkers are installed
Test fails as:
  Test suite doctests: RUNNING...

  test/Servant/API/ContentTypesSpec.hs:31:18:
    Ambiguous module name `Test.QuickCheck.Instances':
      it was found in multiple packages:
      checkers-0.4.4@check_A5bAKHstANbBRqwFoOaIKx testpack-2.1.3.0@testp_BjTqfpWNTOG5Lwlc3iqqG9 quickcheck-instances-0.3.12@quick_3Tkh09kYN8p78zxMKFPcZI
  Test suite doctests: FAIL

Fixed by importing 'Test.QuickCheck.Instances' from "quickcheck-instances".

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
2016-04-16 16:13:58 +01:00
Julian K. Arni
79d4f944a4 less OverlappingInstances noise 2016-01-04 13:09:11 -05:00
Julian K. Arni
82deaeb63c Test cases for bad links. 2015-12-16 13:39:52 +01:00
Julian K. Arni
a3b5652ab9 Refactor RouteResult.
Fix rerouting tests
        Fix 405 > 404 issue with Capture.
        Remove ServantErrWithPriority and Monoid instance
        More tests
        Update auth-combinator for routing changes
2015-10-26 16:54:49 +01:00
Julian K. Arni
afc76b8f6c Remove MatrixParam.
In servant, servant-server, and servant-client.
2015-10-13 21:37:07 +02:00
Nickolay Kudasov
40d2c68897 Use http-api-data package instead of ToText/FromText 2015-10-08 00:38:47 +03:00
Julian K. Arni
6eb7add53a stylish haskell changes
And import fix.
2015-08-18 00:07:12 +02:00
Julian K. Arni
98b6e85128 Contributing 2015-08-17 23:50:42 +02:00
Sönke Hahn
e24cb9ddf6 add stack file 2015-07-26 17:25:07 +08:00
Julian K. Arni
29e3c1a45a Fix isElem for Header.
The intention was obviously to ignore them, but we weren't doing so
    correctly.
2015-07-23 13:24:26 +02:00
Oswyn Brent
8eb592bc15 Fix ordering of CPP directive for aeson test
If the version of aeson used is below 0.9 the current ordering
results in an empty do block.
2015-06-23 14:55:13 +10:00
Alp Mestanogullari
0e22d19800 Make Link take a Maybe argument for MatrixParam, just like QueryParam 2015-06-19 11:30:44 +02:00
Alp Mestanogullari
9fbd312b4c adapt tests to the modified HasLink instance for QueryParam 2015-06-19 10:03:24 +02:00
Julian K. Arni
bef0e880cb Fix sporadic eitherDecodeLenient test failures 2015-06-12 15:45:51 +02:00
Alp Mestanogullari
5c25c56d50 Merge pull request #84 from haskell-servant/wip-json-decode-eof
fix a bug in our `eitherDecodeLenient` function
2015-05-23 12:56:31 +01:00
Christian Marie
54131821a5 servant: allow whitespace before JSON 2015-05-16 12:58:53 +10:00
Christian Marie
ec55177796 servant, servant-server: handle corner case in doctests
They seem to encounter multiple sandboxes sometimes, we now provide a more
helpful error if that happens. Didn't look into why this happens.
2015-05-16 12:45:08 +10:00
Christian Marie
43d0620403 servant: allow whitespace after parsing JSON
This includes some de-duplication in the test suite.
2015-05-16 11:13:41 +10:00
Sönke Hahn
0d47f4527b fix doctests for cabal-install-1.18 2015-05-14 19:47:39 +08:00
Brandon Martin
10a6020ca2 modify delete to allow for response body 2015-05-06 13:21:35 -06:00
Julian K. Arni
f82ca76f7d 7.10 changes 2015-04-22 12:27:18 +02:00
Julian K. Arni
90ad8248d7 prepare merge 2015-04-20 11:21:21 +02:00