Commit Graph

61 Commits

Author SHA1 Message Date
Intolerable a2e003367d
Add HasStatus instance for Headers (that defers StatusOf to underlying value) (#1649)
* Add HasStatus instance for Headers (that defers StatusOf to underlying value)

* changelog.d/1649
2023-02-14 23:28:57 +01:00
Tom Sydney Kerckhove 036102af58
Evaluate NoContent before (not) rendering it. (#1587)
* Evaluate NoContent before rendering it, so it shows up as covered in coverage reports

* failing test as well

* test that NoContent gets rendered if it is not an exception

Co-authored-by: Tom Sydney Kerckhove <syd@cs-syd.eu>
2022-05-04 14:40:26 +02:00
Maxim Koltsov 61111178f0
Support GHC-9.0.1 2021-06-23 23:06:07 +02:00
Intolerable a8f584f80b
add HasLink instance for UVerb (#1370) 2020-12-06 14:19:35 +01:00
Andrey Prokopenko da0c83d318
Add URI fragment as a separate combinator (#1324) 2020-11-18 21:57:20 +03:00
Oleg Grenrus 524b07224f Change build-type: Simple; run doctests on CI via haskell-ci
Don't use hspec-discover in tutorial,
so doctests work on CI
2020-01-10 01:07:31 +02:00
Oleg Grenrus 6d90d48b36 http-media-0.8 changed mapAcceptMedia 2019-04-16 13:58:04 +03:00
Oleg Grenrus f1eb5f93a8 Fix issue #1011: NewlineFraming encodes newline after each element 2018-11-10 01:45:56 +02:00
Oleg Grenrus 17f9237980 Add framingRender examples 2018-11-10 01:44:40 +02:00
Oleg Grenrus 5f947d1c43 Bump version numbers
- Almost everything 0.15; also servant-foreign jumped to 0.15, for
  consistency
- Bump lower bounds of dependencies to most recent versions atm
- Use hspec-2.6.0
- Update `stack.yaml` accordingly
- Use base-compat a bit more
- Drop aeson-compat dependency (in tests and tutorial)
2018-11-09 20:20:26 +02:00
Oleg Grenrus 8feda81fcd Separate Servant.Client.Streaming
- as a bonus only `servant-client` depends on `kan-extensions`
2018-11-08 17:58:21 +02:00
Oleg Grenrus 7634e08352 Make ComprehensiveAPI part of public API
We cannot simply tweak it, it will break tests of other packages.
Including packages not in this repository.
2018-11-06 13:35:47 +02:00
Oleg Grenrus 45c1cbdfd5 Refactor Stream stuff
- Introduce SourceT, which is simple variant of "correct `ListT`".
  There are another variants possible (like in `streaming`),
  but I'm not sure there's much real difference.

- Introduce `Codensity`. There's a flag if people don't want to depend
  on `kan-extensions`.

- `StreamGenerator` and `ResultStream` are both `SourceT`.
  `Stream` combinator in `servant-client` uses `Codensity` for CPS.

- Add servant-machines, servant-conduit, servant-pipes
- Add streaming cookbook: just code, no explanations.
- Add a script to run streaming 'benchmarks'
2018-11-05 15:48:47 +02:00
Oleg Grenrus cfade67c2f Cleanup pre-GHC-8.0 stuff 2018-07-11 01:39:38 +03:00
Oleg Grenrus f9bcc15d0b Apply stylish-haskell on all modules 2018-06-29 23:36:39 +03:00
Oleg Grenrus 2c02287b6b Move Servant.Utils.Links -> Servant.Links. Fixes #997. 2018-06-25 14:27:17 +03:00
Oleg Grenrus 7150f2b603 Remove Servant.Utils.Enter 2018-06-24 22:56:30 +03:00
Oleg Grenrus 46663f29b0 Add safeLink'
Resolves #952
2018-06-01 12:50:56 +03:00
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