add haskell-http-client-generator (#6429)

This commit is contained in:
Jon Schoning
2017-09-05 11:33:48 -05:00
committed by wing328
parent 4eab5406c5
commit c7d145a4ba
117 changed files with 10499 additions and 0 deletions

View File

@@ -0,0 +1,233 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-orphans #-}
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy.Char8 as BCL
import qualified Data.Text as T
import qualified Data.Time as TI
import qualified Lens.Micro as L
import qualified Network.HTTP.Client as NH
import qualified SwaggerPetstore as S
import Data.Monoid ((<>))
-- * MAIN
main :: IO ()
main = do
mgr <- NH.newManager NH.defaultManagerSettings
-- print log messages to sdtout
let config =
S.withStdoutLogging
S.newConfig { S.configHost = "http://0.0.0.0/v2"
-- , S.configLoggingFilter = S.debugLevelFilter
}
putStrLn "******** CONFIG ********"
putStrLn (show config)
putStrLn "******** Pet operations ********"
runPet mgr config
putStrLn "******** Store operations ********"
runStore mgr config
putStrLn "******** User operations ********"
runUser mgr config
putStrLn "******** END ********"
return ()
-- * PET
runPet :: NH.Manager -> S.SwaggerPetstoreConfig -> IO ()
runPet mgr config = do
-- create the request for addPet, encoded with content-type application/json
let addPetRequest = S.addPet S.MimeJSON (S.mkPet "name" ["url1", "url2"])
-- send the rquest with accept header application/json
-- dispatchLbs simply returns the raw Network.HTTP.Client.Response ByteString
addPetResponse <- S.dispatchLbs mgr config addPetRequest S.MimeJSON
-- the Consumes & Produces typeclasses control which 'content-type'
-- and 'accept' encodings are allowed for each operation
-- -- No instance for (S.Produces S.AddPet S.MimePlainText)
-- addPetResponse <- S.dispatchLbs mgr config addPetRequest S.MimePlainText
-- inspect the AddPet type to see typeclasses indicating wihch
-- content-type and accept types (mimeTypes) are valid
-- :i S.AddPet
-- data S.AddPet -- Defined in SwaggerPetstore.API
-- instance S.Produces S.AddPet S.MimeXML
-- -- Defined in SwaggerPetstore.API
-- instance S.Produces S.AddPet S.MimeJSON
-- -- Defined in SwaggerPetstore.API
-- instance S.Consumes S.AddPet S.MimeXML
-- -- Defined in SwaggerPetstore.API
-- instance S.Consumes S.AddPet S.MimeJSON
-- -- Defined in SwaggerPetstore.API
-- instance S.HasBodyParam S.AddPet S.Pet
-- -- Defined in SwaggerPetstore.API
-- since this swagger definition has no response schema defined for
-- the 'addPet' response, we decode the response bytestring manually
case A.eitherDecode (NH.responseBody addPetResponse) of
Right pet@S.Pet { S.petId = Just pid } -> do
-- create the request for getPetById
let getPetByIdRequest = S.getPetById pid
-- dispatchMime returns MimeResult, which includes the
-- expected decoded model object 'Pet', or a parse failure
getPetByIdRequestResult <- S.dispatchMime mgr config getPetByIdRequest S.MimeJSON
case S.mimeResult getPetByIdRequestResult of
Left (S.MimeError _ _) -> return () -- parse error, already displayed in the log
Right r -> putStrLn $ "getPetById: found pet: " <> show r -- display 'Pet' model object, r
-- findPetsByStatus
let findPetsByStatusRequest = S.findPetsByStatus ["available","pending","sold"]
findPetsByStatusResult <- S.dispatchMime mgr config findPetsByStatusRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "findPetsByStatus: found " <> (show . length) r <> " pets") findPetsByStatusResult
-- findPetsByTags
let findPetsByTagsRequest = S.findPetsByTags ["name","tag1"]
findPetsByTagsResult <- S.dispatchMime mgr config findPetsByTagsRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "findPetsByTags: found " <> (show . length) r <> " pets") findPetsByTagsResult
-- updatePet
let updatePetRequest = S.updatePet S.MimeJSON $ pet
{ S.petStatus = Just "available"
, S.petCategory = Just (S.Category (Just 3) (Just "catname"))
}
_ <- S.dispatchLbs mgr config updatePetRequest S.MimeXML
-- requred parameters are included as function arguments, optional parameters are included with applyOptionalParam
-- inspect the UpdatePetWithForm type to see typeclasses indicating optional paramteters (:i S.UpdatePetWithForm)
-- instance S.HasOptionalParam S.UpdatePetWithForm S.Name
-- -- Defined in SwaggerPetstore.API
-- instance S.HasOptionalParam S.UpdatePetWithForm S.Status
-- -- Defined in SwaggerPetstore.API
let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded pid
`S.applyOptionalParam` S.Name "petName"
`S.applyOptionalParam` S.Status "pending"
_ <- S.dispatchLbs mgr config updatePetWithFormRequest S.MimeJSON
-- multipart/form-data file uploads are just a different content-type
let uploadFileRequest = S.uploadFile S.MimeMultipartFormData pid
`S.applyOptionalParam` S.File "package.yaml" -- the file contents of the path are read when dispatched
`S.applyOptionalParam` S.AdditionalMetadata "a package.yaml file"
uploadFileRequestResult <- S.dispatchMime mgr config uploadFileRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "uploadFile: " <> show r) uploadFileRequestResult
-- deletePet
let deletePetRequest = S.deletePet pid
`S.applyOptionalParam` S.ApiUnderscorekey "api key"
_ <- S.dispatchLbs mgr config deletePetRequest S.MimeJSON
return ()
Left e -> putStrLn e
_ -> putStrLn "no Pet id returned"
return ()
-- * STORE
-- declare that 'placeOrder' can recieve a JSON content-type request
instance S.Consumes S.PlaceOrder S.MimeJSON
runStore :: NH.Manager -> S.SwaggerPetstoreConfig -> IO ()
runStore mgr config = do
-- we can set arbitrary headers with setHeader
let getInventoryRequest = S.getInventory
`S.setHeader` [("api_key","special-key")]
getInventoryRequestRequestResult <- S.dispatchMime mgr config getInventoryRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "getInventoryRequest: found " <> (show . length) r <> " results") getInventoryRequestRequestResult
-- placeOrder
now <- TI.getCurrentTime
let placeOrderRequest = S.placeOrder S.MimeJSON (S.mkOrder { S.orderId = Just 21, S.orderQuantity = Just 210, S.orderShipDate = Just now})
placeOrderResult <- S.dispatchMime mgr config placeOrderRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "placeOrderResult: " <> show r) placeOrderResult
let orderId = maybe 10 id $ either (const Nothing) (S.orderId) (S.mimeResult placeOrderResult)
-- getOrderByid
let getOrderByIdRequest = S.getOrderById orderId
getOrderByIdRequestResult <- S.dispatchMime mgr config getOrderByIdRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "getOrderById: found order: " <> show r) getOrderByIdRequestResult
-- deleteOrder
let deleteOrderRequest = S.deleteOrder "21"
_ <- S.dispatchLbs mgr config deleteOrderRequest S.MimeJSON
return ()
-- * USER
-- this swagger definition doesn't declare what content-type the
-- server actually expects for these operations, so delcare it here
instance S.Consumes S.CreateUser S.MimeJSON
instance S.Consumes S.UpdateUser S.MimeJSON
instance S.Consumes S.CreateUsersWithArrayInput S.MimeJSON
instance S.Consumes S.CreateUsersWithListInput S.MimeJSON
-- similarly we declare these operations are allowed to omit the
-- accept header despite what the swagger definition says
instance S.Produces S.CreateUsersWithArrayInput S.MimeNoContent
instance S.Produces S.CreateUsersWithListInput S.MimeNoContent
runUser :: NH.Manager -> S.SwaggerPetstoreConfig -> IO ()
runUser mgr config = do
let username = "hsusername"
-- createUser
let user = S.mkUser { S.userId = Just 21, S.userUsername = Just username }
let createUserRequest = S.createUser S.MimeJSON user
_ <- S.dispatchLbs mgr config createUserRequest S.MimeJSON
-- can use traversals or lenses (model record names are appended with T or L) to view or modify records
let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameT (<> "*") . L.over S.userIdT (+1)) user
let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON users
_ <- S.dispatchLbs mgr config createUsersWithArrayInputRequest S.MimeNoContent
-- createUsersWithArrayInput
let createUsersWithListInputRequest = S.createUsersWithListInput S.MimeJSON users
_ <- S.dispatchLbs mgr config createUsersWithListInputRequest S.MimeNoContent
-- getUserByName
let getUserByNameRequest = S.getUserByName username
getUserByNameResult <- S.dispatchMime mgr config getUserByNameRequest S.MimeJSON
mapM_ (\r -> putStrLn $ "getUserByName: found user: " <> show r) getUserByNameResult
-- loginUser
let loginUserRequest = S.loginUser username "password1"
loginUserResult <- S.dispatchLbs mgr config loginUserRequest S.MimeJSON
BCL.putStrLn $ "loginUser: " <> (NH.responseBody loginUserResult)
-- updateUser
let updateUserRequest = S.updateUser S.MimeJSON username (user { S.userEmail = Just "xyz@example.com" })
_ <- S.dispatchLbs mgr config updateUserRequest S.MimeJSON
-- logoutUser
_ <- S.dispatchLbs mgr config S.logoutUser S.MimeJSON
-- deleteUser
let deleteUserRequest = S.deleteUser username
_ <- S.dispatchLbs mgr config deleteUserRequest S.MimeJSON
return ()

View File

@@ -0,0 +1,45 @@
# swagger-petstore-app
This contains an example application which uses the auto-generated
swagger-petstore API Client: `haskell-http-client`
This module is not auto-generated.
The application requires a swagger petstore server running at
`http://0.0.0.0/v2`, or the value of the `HOST` environment variable.
To compile this application, the api client library bindings generated for swagger-petstore are expected to live in the parent folder.
### Petstore Server
The petstore server can be obtained at:
https://github.com/wing328/swagger-samples/tree/docker/java/java-jersey-jaxrs
Follow the instructions in the readme to install and run the petstore
server (the docker branch is used here, but docker is not required)
### Usage
1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README).
2. Start the petstore server (described above)
3. To run the application:
```
stack --install-ghc exec swagger-petstore-app
```
4. After stack installs ghc on the first run, `--install-ghc` can be omitted
### Optional Environment Variables
* `HOST` - the root url of the petstore server
* `http_proxy` - the address of the http proxy
Example:
```
HOST=http://0.0.0.0/v2 http_proxy=http://0.0.0.0:8080 stack --install-ghc exec swagger-petstore-app
```
### Source Documentation
The application code lives in `Main.hs`, which is commented with additional implementation notes

View File

@@ -0,0 +1,95 @@
******** CONFIG ********
{ configHost = "http://0.0.0.0/v2", configUserAgent = "swagger-haskell-http-client/1.0.0", ..}
******** Pet operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:POST 0.0.0.0/v2/pet
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"photoUrls":["url1","url2"],"name":"name"}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":30,\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[]}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/30
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/30)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":30,\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[]}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
getPetById: found pet: Pet {petId = Just 30, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "[{\"id\":1,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":2,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"available\"},{\"id\":3,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"pending\"},{\"id\":4,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":5,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"sold\"},{\"id\":6,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"pending\"},{\"id\":7,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":8,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"available\"},{\"id\":9,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"available\"},{\"id\":10,\"category\":{\"id\":3,\"name\":\"Rabbits\"},\"name\":\"Rabbit 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"available\"},{\"id\":25,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"available\"},{\"id\":26,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"petName\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"pending\"},{\"id\":27,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"petName\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"pending\"}]", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
findPetsByStatus: found 13 pets
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "[{\"id\":1,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":4,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":7,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"}]", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
findPetsByTags: found 3 pets
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:PUT 0.0.0.0/v2/pet
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/xml")] Body={"photoUrls":["url1","url2"],"status":"available","category":{"name":"catname","id":3},"name":"name","id":30,"tags":[]}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (PUT 0.0.0.0/v2/pet)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/xml"),("Content-Length","251"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Pet><category><id>3</id><name>catname</name></category><id>30</id><name>name</name><photoUrls><photoUrl>url1</photoUrl><photoUrl>url2</photoUrl></photoUrls><status>available</status><tags/></Pet>", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/pet/30
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/x-www-form-urlencoded"),("accept","application/json;charset=utf-8")] Body=status=pending&name=petName
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/pet/30/uploadImage
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("Content-Type","multipart/form-data; boundary=----WebKitFormBoundarytMtEWXPCyyC5CTsF"),("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30/uploadImage)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"code\":200,\"type\":\"unknown\",\"message\":\"additionalMetadata: a package.yaml file\\nFile uploaded to ./package.yaml, 893 bytes\"}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 893 bytes"}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/pet/30
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8"),("api_key","api key")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/30)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
******** Store operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/store/inventory
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8"),("api_key","special-key")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"sold\":1,\"pending\":4,\"available\":8}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
getInventoryRequest: found 3 results
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/store/order
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"quantity":210,"id":21,"shipDate":"2017-09-02T19:52:04.306Z"}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/store/order)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"petId\":0,\"quantity\":210,\"shipDate\":\"2017-09-02T19:52:04.306+0000\",\"complete\":false}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:52:04.306 UTC, orderStatus = Nothing, orderComplete = Just False}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/store/order/21
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"petId\":0,\"quantity\":210,\"shipDate\":\"2017-09-02T19:52:04.306+0000\",\"complete\":false}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
getOrderById: found order: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:52:04.306 UTC, orderStatus = Nothing, orderComplete = Just False}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/store/order/21
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
******** User operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"username":"hsusername","id":21}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user/createWithArray
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8")] Body=[{"username":"hsusername*","id":22},{"username":"hsusername**","id":23},{"username":"hsusername***","id":24},{"username":"hsusername****","id":25},{"username":"hsusername*****","id":26},{"username":"hsusername******","id":27},{"username":"hsusername*******","id":28},{"username":"hsusername********","id":29}]
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user/createWithList
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8")] Body=[{"username":"hsusername*","id":22},{"username":"hsusername**","id":23},{"username":"hsusername***","id":24},{"username":"hsusername****","id":25},{"username":"hsusername*****","id":26},{"username":"hsusername******","id":27},{"username":"hsusername*******","id":28},{"username":"hsusername********","id":29}]
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/hsusername
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"username\":\"hsusername\",\"userStatus\":0}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
getUserByName: found user: User {userId = Just 21, userUsername = Just "hsusername", userFirstName = Nothing, userLastName = Nothing, userEmail = Nothing, userPassword = Nothing, userPhone = Nothing, userUserStatus = Just 0}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("X-Expires-After","Sat Sep 02 15:52:04 CDT 2017"),("X-Rate-Limit","5000"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "logged in user session:1504381924767", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
loginUser: logged in user session:1504381924767
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:PUT 0.0.0.0/v2/user/hsusername
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"email":"xyz@example.com","username":"hsusername","id":21}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/logout
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/logout)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/user/hsusername
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body=<RequestBody>
[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername)
[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
******** END ********

View File

@@ -0,0 +1,55 @@
******** CONFIG ********
{ configHost = "http://0.0.0.0/v2", configUserAgent = "swagger-haskell-http-client/1.0.0", ..}
******** Pet operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:POST 0.0.0.0/v2/pet
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/30
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/30)
getPetById: found pet: Pet {petId = Just 30, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing}
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold)
findPetsByStatus: found 13 pets
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1)
findPetsByTags: found 3 pets
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:PUT 0.0.0.0/v2/pet
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (PUT 0.0.0.0/v2/pet)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:POST 0.0.0.0/v2/pet/30
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/pet/30/uploadImage
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30/uploadImage)
uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 893 bytes"}
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/pet/30
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/30)
******** Store operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/store/inventory
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory)
getInventoryRequest: found 3 results
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/store/order
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/store/order)
placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:51:50.222 UTC, orderStatus = Nothing, orderComplete = Just False}
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/store/order/21
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21)
getOrderById: found order: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:51:50.222 UTC, orderStatus = Nothing, orderComplete = Just False}
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/store/order/21
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21)
******** User operations ********
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user/createWithArray
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user/createWithList
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/hsusername
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername)
getUserByName: found user: User {userId = Just 21, userUsername = Just "hsusername", userFirstName = Nothing, userLastName = Nothing, userEmail = Nothing, userPassword = Nothing, userPhone = Nothing, userUserStatus = Just 0}
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername)
loginUser: logged in user session:1504381910612
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:PUT 0.0.0.0/v2/user/hsusername
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/logout
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/logout)
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/user/hsusername
[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername)
******** END ********

View File

@@ -0,0 +1,37 @@
name: swagger-petstore-app
version: '0.1.0.0'
synopsis: Auto-generated swagger-petstore API Client
description: ! '
Sample app for calling the swagger-petstore API based on http-client.
'
category: Web
author: Author Name Here
maintainer: author.name@email.com
copyright: YEAR - AUTHOR
license: UnspecifiedLicense
homepage: https://github.com/swagger-api/swagger-codegen#readme
extra-source-files:
- README.md
ghc-options: -Wall
dependencies:
- base >=4.7 && <5.0
- transformers >=0.4.0.0
- mtl >=2.2.1
- unordered-containers
- containers >=0.5.0.0 && <0.6
- aeson >=1.0 && <2.0
- bytestring >=0.10.0 && <0.11
- http-types >=0.8 && <0.10
- http-client >=0.5 && <0.6
- http-client-tls
- http-api-data >= 0.3.4 && <0.4
- http-media >= 0.4 && < 0.8
- text >=0.11 && <1.3
- time >=1.5 && <1.9
- vector >=0.10.9 && <0.13
- case-insensitive
- swagger-petstore
- microlens
executables:
swagger-petstore-app:
main: Main.hs

View File

@@ -0,0 +1,5 @@
resolver: lts-9.0
packages:
- location: '.'
- location: '..'
extra-dep: true

View File

@@ -0,0 +1,43 @@
-- This file has been generated from package.yaml by hpack version 0.17.1.
--
-- see: https://github.com/sol/hpack
name: swagger-petstore-app
version: 0.1.0.0
synopsis: Auto-generated swagger-petstore API Client
description: Sample app for calling the swagger-petstore API based on http-client.
category: Web
homepage: https://github.com/swagger-api/swagger-codegen#readme
author: Author Name Here
maintainer: author.name@email.com
copyright: YEAR - AUTHOR
license: UnspecifiedLicense
build-type: Simple
cabal-version: >= 1.10
extra-source-files:
README.md
executable swagger-petstore-app
main-is: Main.hs
ghc-options: -Wall
build-depends:
base >=4.7 && <5.0
, transformers >=0.4.0.0
, mtl >=2.2.1
, unordered-containers
, containers >=0.5.0.0 && <0.6
, aeson >=1.0 && <2.0
, bytestring >=0.10.0 && <0.11
, http-types >=0.8 && <0.10
, http-client >=0.5 && <0.6
, http-client-tls
, http-api-data >= 0.3.4 && <0.4
, http-media >= 0.4 && < 0.8
, text >=0.11 && <1.3
, time >=1.5 && <1.9
, vector >=0.10.9 && <0.13
, case-insensitive
, swagger-petstore
, microlens
default-language: Haskell2010