Commit Graph
4732 Commits
Author SHA1 Message Date
Joe NelsonandGitHub 1d5a0e4316 Per-route content negotiation, and OpenAPI only for root (#693)
* WIP: remove non-openapi root spec

* Refactor ContentType

Different endpoints will favor one type over another

* Permit different Accept headers per endpoint

* Lint

* Add charset to Content-Type only when used as a header

Keep it out of error messages

* Accept: */* is last resort, not first

* Changelog

* makeMimeList consistently

* Remove schema description from OPTIONS response
2016-08-19 16:07:22 -07:00
Erlend HambergandJoe Nelson 35c5b190b4 Singular response for PATCH request (#634)
* Allow a singular entity to be returned from an update

Since a `PATCH` will be an update that could affect many rows, there might be
more than one object returned. By allowing asking for a singular response,
the/an object will be returned instead of a list. This is useful in cases when
the `PATCH` is against single entity (i.e. `/items?pkey=eq.99`).

* Add tests for plurality=singular for `PATCH` requests

* Disallow updating more than one row if `plurality=singular`

As discussed in #634, we don't want to allow updating several rows with
a `PATCH` request when the `Prefer` header specifies
`return=representation;plurality=singular` as this would almost
certainly be a client error.

* Add test for patching multiple objects with singular response

Patching > 1 object with `return=representation;plurality=singular`
should return `400 Bad Request`.

* Only add singleton range for read API requests

* Disallow inserting more than one row if `plurality=singular`

Disallow inserting several rows with a `POST` request when the `Prefer`
header specifies `return=representation;plurality=singular` as this
would almost certainly be a client error.

* Only import `q` from `Text.InterpolatedString.Perl6`

* Update OpenAPI response for PATCH/POST to mention `plurality=singular`

The OpenAPI response for PATCH/POST requests now includes the `Prefer` value
`return=representation;plurality=singular`.

* Add entry in changelog
2016-08-19 14:02:14 -07:00
Stephen Diehl e14e1e3613 Change log for 0.1.7. 2016-08-15 08:43:55 -04:00
Stephen Diehl d17fc9aab3 traceShow and traceShowId for #16 2016-08-13 16:14:15 -04:00
Stephen Diehl 5bf3b7f812 Full outline. 2016-07-29 12:28:29 -04:00
Stephen Diehl 5de8f47138 Stubs. 2016-07-29 12:07:32 -04:00
Stephen Diehl 4437583e3f Fix links. 2016-07-29 11:36:38 -04:00
Stephen Diehl 76f3f9f17c monad docs 2016-07-29 11:33:32 -04:00
Diogo BiazusandJoe Nelson df6cbc4afa Protolude second movement (#677)
* Replace Prelude import for Protolude in middleware

* Remove qualifier from Text type

* Replace Prelude for Protolude, replace 'cs' for 'toS' calls, also change some name bindings

* Replace Prelude in main for Protolude. Replace error calls for panic calls. Also replace cs for toS

* Replace Prelude for Protolude

* Replace Prelude for Protolude in OpenAPI
2016-07-23 12:20:36 -07:00
Stephen Diehl 1cb0630529 New symbol documentation. 2016-07-21 14:49:09 -04:00
Joe NelsonandGitHub d93d07795b Merge pull request #675 from begriffs/bump-hjsonschema
Use real version of hjsonschema
2016-07-18 12:19:22 -07:00
Joe Nelson c98450d1d5 Use real version of hjsonschema
Its raw commit on github no longer exists
2016-07-18 11:37:38 -07:00
Joe NelsonandGitHub b6e100096d Merge pull request #672 from begriffs/cache-warning
Add schema cache freshness warning
2016-07-16 17:04:15 -07:00
Joe Nelson 338c4de8b4 Add schema cache freshness warning 2016-07-11 16:46:39 -07:00
Joe NelsonandGitHub b5d720e091 Merge pull request #649 from hudayou/proxy-awareness
Add proxy awareness for OpenAPI spec generation
2016-07-07 08:25:30 -07:00
Joe NelsonandGitHub 2b1ca9f5b7 Merge pull request #662 from begriffs/raise-400
Translate raise_exception to http 400
2016-07-07 08:15:26 -07:00
Jacky Hu 1fef1991ef Add proxy awareness for OpenAPI spec generation
Proxy uri from command line options takes precedence over host and port
2016-07-07 19:20:40 +08:00
Joe Nelson e4cf1ce207 Translate raise_exception to http 400
Fixes #661
2016-07-06 21:48:32 -07:00
Joe NelsonandGitHub 63046baffd Merge pull request #620 from ruslantalpa/rpc_refactor
Rpc refactor
2016-07-06 20:51:05 -07:00
Stephen Diehl 7aa8b6646e Expose `state and `reader` functions. 2016-07-05 07:22:46 -04:00
Stephen Diehl 245dd5190e Explicitly lift throwIO and throwTo. 2016-07-02 20:11:20 -04:00
Stephen Diehl 2f619f3ebd Link to pretty printer library. 2016-07-02 17:57:44 -04:00
Stephen Diehl b658b4c8ef Note explicit String types. 2016-07-02 17:32:11 -04:00
Stephen Diehl b621258ce7 Better example text for panic. 2016-07-02 17:31:00 -04:00
Stephen Diehl 827c0ef87b Formatting for FAQ. 2016-07-02 17:27:40 -04:00
Stephen Diehl 6b6f8967ac Note about exception handling. 2016-07-02 14:00:26 -04:00
Stephen Diehl 21be7f2908 Fix 0.1.6 changelog. 2016-07-02 13:50:31 -04:00
Stephen Diehl f0fd11791c Add unsnoc function. 2016-07-01 11:25:10 -04:00
Stephen Diehl f6586ba8b4 Change safety language flags. 2016-06-30 23:02:39 -04:00
Stephen Diehl 63d5ed625d Encoding functions in scope by default. 2016-06-30 22:56:00 -04:00
Stephen Diehl c2ca1677c8 Control.Exception as qualified import. 2016-06-30 18:49:28 -04:00
Stephen Diehl b8479ebcb5 Move throw to Unsafe exports. 2016-06-30 18:48:55 -04:00
Stephen Diehl 89fdc587e0 Single SrcLoc export. 2016-06-30 18:28:21 -04:00
Stephen Diehl cf1fa981ef Remove showCallStack. 2016-06-30 18:14:30 -04:00
Stephen Diehl cef28ed3a0 Remove throw and assert exports. 2016-06-30 17:59:09 -04:00
Stephen Diehl 205643ea14 Callstack for GHC 8.x. 2016-06-30 17:45:39 -04:00
Joe NelsonandGitHub d102d954ac Merge pull request #657 from diogob/protolude-first-fugues
Protolude first fugues
2016-06-30 08:27:58 -07:00
Stephen Diehl fa58c5452a Added changelog. 2016-06-30 11:14:47 -04:00
Stephen Diehl 22c0e743f9 Added changelog. 2016-06-30 11:09:58 -04:00
Stephen Diehl f4178f0472 FAQ section. 2016-06-30 11:04:51 -04:00
Stephen Diehl e2b886bb64 MOre specializers. 2016-06-30 10:59:15 -04:00
Stephen Diehl a7bc40452f Fix up bound documentation. 2016-06-30 10:49:13 -04:00
Stephen Diehl 0aa40b8b21 Don't support alternative Base. 2016-06-30 10:41:55 -04:00
Diogo Biazus 578ae6b5dd Import GHC.Show without qualifying it 2016-06-30 08:35:42 -04:00
Joe NelsonandGitHub f7aa8b7ad5 Merge pull request #656 from diogob/simplify-pTreePath
Remove unnecessary string conversions
2016-06-29 20:37:15 -07:00
Diogo Biazus 7b9eb86fd0 Stop running openpi test until we figure out a way to run it in circle without a suite timeout 2016-06-29 10:14:38 -04:00
Diogo Biazus b17fa09393 Add explicit import Prelude to remaining modules to compile and run specs 2016-06-29 09:26:47 -04:00
Diogo Biazus 0e172b8030 Port Auth to prolude 2016-06-29 09:25:57 -04:00
Diogo Biazus 3308012dcf Add protolude to dependencies, include NoImplicitPrelude in default extensions and port Error module to protolude. 2016-06-29 09:25:57 -04:00
Diogo Biazus 376b67be9e Remove unnecessary string conversions 2016-06-29 00:18:29 -04:00