[haskell-http-client] Allow logger selection via cabal flags. Emit Consumes */* for requestBody when not specified

[haskell-http-client] Allow logger selection via cabal flags. Emit Consumes */* for requestBody when not specified
This commit is contained in:
Jon Schoning
2019-02-28 13:04:50 -06:00
committed by GitHub
parent 84b99fea54
commit c30a21ac3c
85 changed files with 5585 additions and 5072 deletions

View File

@@ -155,7 +155,6 @@ runPet mgr config = do
-- * STORE
instance S.Consumes S.PlaceOrder S.MimeJSON
runStore :: NH.Manager -> S.OpenAPIPetstoreConfig -> IO ()
runStore mgr config = do
@@ -189,11 +188,6 @@ runStore mgr config = do
-- * USER
instance S.Consumes S.CreateUser S.MimeJSON
instance S.Consumes S.CreateUsersWithArrayInput S.MimeJSON
instance S.Consumes S.CreateUsersWithListInput S.MimeJSON
instance S.Consumes S.UpdateUser S.MimeJSON
runUser :: NH.Manager -> S.OpenAPIPetstoreConfig -> IO ()
runUser mgr config = do
@@ -205,11 +199,11 @@ runUser mgr config = do
-- can use lenses (model record names are appended L) to view or modify records
let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameL (fmap (<> "*")) . L.over S.userIdL (fmap (+ 1))) user
let createUsersWithArrayInputRequest = S.createUsersWithArrayInput (S.ContentType S.MimeJSON) (S.User2 users)
let createUsersWithArrayInputRequest = S.createUsersWithArrayInput (S.ContentType S.MimeJSON) (S.Body users)
_ <- S.dispatchLbs mgr config createUsersWithArrayInputRequest
-- createUsersWithArrayInput
let createUsersWithListInputRequest = S.createUsersWithListInput (S.ContentType S.MimeJSON) (S.User2 users)
let createUsersWithListInputRequest = S.createUsersWithListInput (S.ContentType S.MimeJSON) (S.Body users)
_ <- S.dispatchLbs mgr config createUsersWithListInputRequest
-- getUserByName

View File

@@ -2,7 +2,7 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 56ae3aaeafb9097357340f607e1eaf6de362bdf849f038e8495e41eedc747747
-- hash: ac93c2ec93cd0d2783d67276552e1c6bac8001151915ed0b6c698df9738859b5
name: openapi-petstore-app
version: 0.1.0.0
@@ -21,18 +21,20 @@ extra-source-files:
executable openapi-petstore-app
main-is: Main.hs
other-modules:
Paths_openapi_petstore_app
ghc-options: -Wall
build-depends:
aeson >=1.0 && <2.0
, base >=4.7 && <5.0
, bytestring >=0.10.0 && <0.11
, case-insensitive
, containers >=0.5.0.0 && <0.6
, http-api-data >=0.3.4 && <0.4
, containers >=0.5.0.0 && <0.8
, http-api-data >=0.3.4 && <0.5
, http-client >=0.5 && <0.6
, http-client-tls
, http-media >=0.4 && <0.8
, http-types >=0.8 && <0.12
, http-types >=0.8 && <0.13
, microlens >=0.4.3 && <0.5
, mtl >=2.2.1
, openapi-petstore
@@ -41,6 +43,4 @@ executable openapi-petstore-app
, transformers >=0.4.0.0
, unordered-containers
, vector >=0.10.9 && <0.13
other-modules:
Paths_openapi_petstore_app
default-language: Haskell2010

View File

@@ -18,13 +18,13 @@ dependencies:
- transformers >=0.4.0.0
- mtl >=2.2.1
- unordered-containers
- containers >=0.5.0.0 && <0.6
- containers >=0.5.0.0 && <0.8
- aeson >=1.0 && <2.0
- bytestring >=0.10.0 && <0.11
- http-types >=0.8 && <0.12
- http-types >=0.8 && <0.13
- http-client >=0.5 && <0.6
- http-client-tls
- http-api-data >= 0.3.4 && <0.4
- http-api-data >= 0.3.4 && <0.5
- http-media >= 0.4 && < 0.8
- text >=0.11 && <1.3
- time >=1.5 && <1.9

View File

@@ -1,4 +1,4 @@
resolver: lts-10.10
resolver: lts-13.9
packages:
- location: '.'
- location: '..'