Merge pull request #842 from phadej/http-types-0.10b

Http types 0.10b
This commit is contained in:
Oleg Grenrus 2017-10-25 13:08:15 +03:00 committed by GitHub
commit de965b208e
9 changed files with 41 additions and 8 deletions

View file

@ -8,6 +8,14 @@ author: Servant Contributors
maintainer: haskell-servant-maintainers@googlegroups.com maintainer: haskell-servant-maintainers@googlegroups.com
build-type: Simple build-type: Simple
cabal-version: >=1.10 cabal-version: >=1.10
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
extra-source-files:
static/index.html
static/ui.js
library library
exposed-modules: ApiType exposed-modules: ApiType
@ -38,7 +46,8 @@ library
, string-conversions , string-conversions
, bytestring , bytestring
, attoparsec , attoparsec
, mtl , mtl >=2.1 && <2.3
, mtl-compat
, random , random
, js-jquery , js-jquery
, wai , wai
@ -57,6 +66,8 @@ test-suite spec
hs-source-dirs: test hs-source-dirs: test
main-is: Spec.hs main-is: Spec.hs
other-modules: JavascriptSpec other-modules: JavascriptSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: base == 4.* build-depends: base == 4.*
, tutorial , tutorial
, hspec , hspec

View file

@ -43,7 +43,7 @@ library
, generics-sop >= 0.1.0.0 && < 0.4 , generics-sop >= 0.1.0.0 && < 0.4
, http-api-data >= 0.3.6 && < 0.4 , http-api-data >= 0.3.6 && < 0.4
, http-media >= 0.6.2 && < 0.8 , http-media >= 0.6.2 && < 0.8
, http-types >= 0.8.6 && < 0.10 , http-types >= 0.8.6 && < 0.11
, mtl >= 2.1 && < 2.3 , mtl >= 2.1 && < 2.3
, network-uri >= 2.6 && < 2.7 , network-uri >= 2.6 && < 2.7
, safe >= 0.3.9 && < 0.4 , safe >= 0.3.9 && < 0.4
@ -70,5 +70,7 @@ test-suite spec
, servant-client-core , servant-client-core
, hspec == 2.* , hspec == 2.*
, QuickCheck >= 2.7 && < 2.11 , QuickCheck >= 2.7 && < 2.11
build-tool-depends:
hspec-discover:hspec-discover
other-modules: other-modules:
Servant.Client.Core.Internal.BaseUrlSpec Servant.Client.Core.Internal.BaseUrlSpec

View file

@ -41,7 +41,7 @@ library
, http-client >= 0.4.30 && < 0.6 , http-client >= 0.4.30 && < 0.6
, http-client-tls >= 0.2.2 && < 0.4 , http-client-tls >= 0.2.2 && < 0.4
, http-media >= 0.6.2 && < 0.8 , http-media >= 0.6.2 && < 0.8
, http-types >= 0.8.6 && < 0.10 , http-types >= 0.8.6 && < 0.11
, exceptions >= 0.8 && < 0.9 , exceptions >= 0.8 && < 0.9
, monad-control >= 1.0.0.4 && < 1.1 , monad-control >= 1.0.0.4 && < 1.1
, mtl >= 2.1 && < 2.3 , mtl >= 2.1 && < 2.3
@ -64,6 +64,8 @@ test-suite spec
default-language: Haskell2010 default-language: Haskell2010
hs-source-dirs: test hs-source-dirs: test
main-is: Spec.hs main-is: Spec.hs
build-tool-depends:
hspec-discover:hspec-discover
other-modules: other-modules:
Servant.ClientSpec Servant.ClientSpec
build-depends: build-depends:

View file

@ -75,6 +75,8 @@ test-suite spec
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: Spec.hs main-is: Spec.hs
other-modules: Servant.DocsSpec other-modules: Servant.DocsSpec
build-tool-depends:
hspec-discover:hspec-discover
hs-source-dirs: test hs-source-dirs: test
ghc-options: -Wall ghc-options: -Wall
build-depends: build-depends:

View file

@ -65,6 +65,8 @@ test-suite spec
include-dirs: include include-dirs: include
main-is: Spec.hs main-is: Spec.hs
other-modules: Servant.ForeignSpec other-modules: Servant.ForeignSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: base build-depends: base
, hspec >= 2.1.8 , hspec >= 2.1.8
, servant , servant

View file

@ -60,7 +60,7 @@ library
, containers >= 0.5 && < 0.6 , containers >= 0.5 && < 0.6
, exceptions >= 0.8 && < 0.9 , exceptions >= 0.8 && < 0.9
, http-api-data >= 0.3 && < 0.4 , http-api-data >= 0.3 && < 0.4
, http-types >= 0.8 && < 0.10 , http-types >= 0.8 && < 0.11
, network-uri >= 2.6 && < 2.7 , network-uri >= 2.6 && < 2.7
, monad-control >= 1.0.0.4 && < 1.1 , monad-control >= 1.0.0.4 && < 1.1
, mtl >= 2 && < 2.3 , mtl >= 2 && < 2.3
@ -120,6 +120,8 @@ test-suite spec
Servant.Server.UsingContextSpec.TestCombinators Servant.Server.UsingContextSpec.TestCombinators
Servant.ServerSpec Servant.ServerSpec
Servant.Utils.StaticFilesSpec Servant.Utils.StaticFilesSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: build-depends:
base == 4.* base == 4.*
, base-compat , base-compat

View file

@ -33,7 +33,11 @@ import Network.HTTP.Types (Status (..), hAccept, hContentType,
methodDelete, methodGet, methodDelete, methodGet,
methodHead, methodPatch, methodHead, methodPatch,
methodPost, methodPut, ok200, methodPost, methodPut, ok200,
#if MIN_VERSION_http_types(0,10,0)
imATeapot418,
#else
imATeaPot418, imATeaPot418,
#endif
parseQuery) parseQuery)
import Network.Wai (Application, Request, requestHeaders, pathInfo, import Network.Wai (Application, Request, requestHeaders, pathInfo,
queryString, rawQueryString, queryString, rawQueryString,
@ -70,6 +74,11 @@ import Servant.Server.Experimental.Auth
import Servant.Server.Internal.Context import Servant.Server.Internal.Context
(NamedContext(..)) (NamedContext(..))
#if !MIN_VERSION_http_types(0,10,0)
imATeapot418 :: Status
imATeapot418 = imATeaPot418
#endif
-- * comprehensive api test -- * comprehensive api test
-- This declaration simply checks that all instances are in place. -- This declaration simply checks that all instances are in place.
@ -662,7 +671,7 @@ basicAuthApi = Proxy
basicAuthServer :: Server BasicAuthAPI basicAuthServer :: Server BasicAuthAPI
basicAuthServer = basicAuthServer =
const (return jerry) :<|> const (return jerry) :<|>
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "") (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
basicAuthContext :: Context '[ BasicAuthCheck () ] basicAuthContext :: Context '[ BasicAuthCheck () ]
basicAuthContext = basicAuthContext =
@ -707,7 +716,7 @@ genAuthApi = Proxy
genAuthServer :: Server GenAuthAPI genAuthServer :: Server GenAuthAPI
genAuthServer = const (return tweety) genAuthServer = const (return tweety)
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "") :<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
type instance AuthServerData (AuthProtect "auth") = () type instance AuthServerData (AuthProtect "auth") = ()

View file

@ -66,7 +66,7 @@ library
, case-insensitive >= 1.2 && < 1.3 , case-insensitive >= 1.2 && < 1.3
, http-api-data >= 0.3 && < 0.4 , http-api-data >= 0.3 && < 0.4
, http-media >= 0.4 && < 0.8 , http-media >= 0.4 && < 0.8
, http-types >= 0.8 && < 0.10 , http-types >= 0.8 && < 0.11
, natural-transformation >= 0.4 && < 0.5 , natural-transformation >= 0.4 && < 0.5
, mtl >= 2.0 && < 2.3 , mtl >= 2.0 && < 2.3
, mmorph >= 1 && < 1.2 , mmorph >= 1 && < 1.2
@ -118,6 +118,8 @@ test-suite spec
Servant.API.ResponseHeadersSpec Servant.API.ResponseHeadersSpec
Servant.Utils.LinksSpec Servant.Utils.LinksSpec
Servant.Utils.EnterSpec Servant.Utils.EnterSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: build-depends:
base == 4.* base == 4.*
, base-compat , base-compat

View file

@ -10,7 +10,8 @@ packages:
extra-deps: extra-deps:
- aeson-1.2.0.0 - aeson-1.2.0.0
- attoparsec-iso8601-1.0.0.0 - attoparsec-iso8601-1.0.0.0
- http-media-0.7.0
- cabal-doctest-1.0.2 - cabal-doctest-1.0.2
- http-api-data-0.3.7 - http-api-data-0.3.7
- http-media-0.7.0
- http-types-0.10
- servant-js-0.9.3 - servant-js-0.9.3