diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java index a7cc41fd230..f7f529a79a4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java @@ -44,6 +44,8 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected String defaultDateFormat = "%Y-%m-%d"; + protected Boolean useMonadLogger = false; + // CLI public static final String ALLOW_FROMJSON_NULLS = "allowFromJsonNulls"; public static final String ALLOW_TOJSON_NULLS = "allowToJsonNulls"; @@ -54,6 +56,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC public static final String GENERATE_MODEL_CONSTRUCTORS = "generateModelConstructors"; public static final String MODEL_DERIVING = "modelDeriving"; public static final String STRICT_FIELDS = "strictFields"; + public static final String USE_MONAD_LOGGER = "useMonadLogger"; // protected String MODEL_IMPORTS = "modelImports"; // protected String MODEL_EXTENSIONS = "modelExtensions"; @@ -192,7 +195,8 @@ public HaskellHttpClientCodegen() { cliOptions.add(CliOption.newBoolean(GENERATE_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newString(MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); - cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.FALSE.toString()))); + cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.TRUE.toString()))); + cliOptions.add(CliOption.newBoolean(USE_MONAD_LOGGER, "Use the monad-logger package to provide logging (if false, use the katip logging package)").defaultValue((Boolean.FALSE.toString()))); cliOptions.add(CliOption.newString(DATETIME_FORMAT, "format string used to parse/render a datetime")); cliOptions.add(CliOption.newString(DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); @@ -252,6 +256,11 @@ public void setStrictFields(Boolean value) { additionalProperties.put("x-strictFields", value); } + public void setUseMonadLogger(Boolean value) { + additionalProperties.put("x-useMonadLogger", value); + this.useMonadLogger = value; + } + @Override public void processOpts() { super.processOpts(); @@ -313,7 +322,12 @@ public void processOpts() { if (additionalProperties.containsKey(STRICT_FIELDS)) { setStrictFields(convertPropertyToBoolean(STRICT_FIELDS)); } else { - setStrictFields(false); + setStrictFields(true); + } + if (additionalProperties.containsKey(USE_MONAD_LOGGER)) { + setUseMonadLogger(convertPropertyToBoolean(USE_MONAD_LOGGER)); + } else { + setUseMonadLogger(false); } } @@ -377,6 +391,9 @@ public void preprocessSwagger(Swagger swagger) { supportingFiles.add(new SupportingFile("Model.mustache", "lib/" + apiName, "Model.hs")); supportingFiles.add(new SupportingFile("MimeTypes.mustache", "lib/" + apiName, "MimeTypes.hs")); + // logger + supportingFiles.add(new SupportingFile(useMonadLogger ? "LoggingMonadLogger.mustache" : "LoggingKatip.mustache", "lib/" + apiName, "Logging.hs")); + // modelTemplateFiles.put("API.mustache", ".hs"); // apiTemplateFiles.put("Model.mustache", ".hs"); diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index f23f0ebf1dd..68228e22bbb 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -17,6 +17,7 @@ module {{title}}.Client where import {{title}}.Model import {{title}}.API import {{title}}.MimeTypes +import {{title}}.Logging import qualified Control.Monad.IO.Class as P import qualified Data.Aeson as A @@ -30,8 +31,6 @@ import Web.FormUrlEncoded as WH import Web.HttpApiData as WH import Control.Monad.Catch (MonadThrow) -import qualified Control.Monad.Logger as LG - import qualified Data.Time as TI import qualified Data.Map as Map import qualified Data.Text as T @@ -57,8 +56,8 @@ import qualified Control.Exception.Safe as E data {{configType}} = {{configType}} { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger } -- | display the config @@ -79,29 +78,29 @@ instance Show {{configType}} where -- -- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}"@ -- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: {{configType}} -newConfig = - {{configType}} - { configHost = "{{basePath}}" - , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: {{configType}} -> {{configType}} -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: {{configType}} -> {{configType}} -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +newConfig :: IO {{configType}} +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "{{{basePath}}}" + , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: {{configType}} -> IO {{configType}} +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: {{configType}} -> IO {{configType}} +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: {{configType}} -> {{configType}} -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * Dispatch @@ -146,10 +145,10 @@ dispatchMime dispatchMime manager config request accept = do httpResponse <- dispatchLbs manager config request accept parsedResult <- - runExceptionLoggingT "Client" config $ + runConfigLogWithExceptions "Client" config $ do case mimeUnrender' accept (NH.responseBody httpResponse) of Left s -> do - logNST LG.LevelError "Client" (T.pack s) + _log "Client" levelError (T.pack s) pure (Left (MimeError s httpResponse)) Right r -> pure (Right r) return (MimeResult parsedResult httpResponse) @@ -187,15 +186,15 @@ dispatchInitUnsafe -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) return res where - logSrc = "Client" + src = "Client" endpoint = T.pack $ BC.unpack $ @@ -250,68 +249,16 @@ modifyInitRequest (InitRequest req) f = InitRequest (f req) modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) --- * Logging - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - -- ** Logging --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "{{title}}/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: {{configType}} -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT +-- | Run a block using the configured logger instance +runConfigLog + :: P.MonadIO m + => {{configType}} -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) + +-- | Run a block using the configured logger instance (logs exceptions) +runConfigLogWithExceptions :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> {{configType}} -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + => T.Text -> {{configType}} -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache new file mode 100644 index 00000000000..470df933b09 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -0,0 +1,108 @@ +{-| +Module : {{title}}.Logging +Katip Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module {{title}}.Logging where + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import qualified Katip as LG + +-- * Type Aliases (for compatability) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A Katip logging block +type LogExec m = forall a. LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "{{title}}" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache new file mode 100644 index 00000000000..a9737b70e01 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache @@ -0,0 +1,117 @@ +{-| +Module : {{title}}.Logging +monad-logger Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module {{title}}.Logging where + +import Data.Text (Text) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Data.Text as T +import qualified Data.Time as TI +import Data.Monoid ((<>)) + +import qualified Control.Monad.Logger as LG + +-- * Type Aliases (for compatability) + +-- | Runs a monad-logger block with the filter predicate +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A monad-logger block +type LogExec m = forall a. LG.LoggingT m a -> m a + +-- | A monad-logger filter predicate +type LogContext = LG.LogSource -> LG.LogLevel -> Bool + +-- | A monad-logger log level +type LogLevel = LG.LogLevel + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = pure infoLevelFilter + +-- | Runs a monad-logger block with the filter predicate +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = runNullLogExec + +-- * stdout logger + +-- | Runs a monad-logger block targeting stdout, with the filter predicate +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec cxt = LG.runStdoutLoggingT . LG.filterLogger cxt + +-- | @pure@ +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext = pure + +-- * stderr logger + +-- | Runs a monad-logger block targeting stderr, with the filter predicate +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec cxt = LG.runStderrLoggingT . LG.filterLogger cxt + +-- | @pure@ +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext = pure + +-- * Null logger + +-- | Disables monad-logger logging +runNullLogExec :: LogExecWithContext +runNullLogExec = const (`LG.runLoggingT` nullLogger) + +-- | monad-logger which does nothing +nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () +nullLogger _ _ _ _ = return () + +-- * Log Msg + +-- | Log a message using the current time +_log :: (P.MonadIO m, LG.MonadLogger m) => Text -> LG.LogLevel -> Text -> m () +_log src level msg = do + now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) + LG.logOtherNS ("{{title}}." <> src) level ("[" <> now <> "] " <> msg) + where + formatTimeLog = + T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.LevelError ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.LevelInfo + +levelError :: LogLevel +levelError = LG.LevelError + +levelDebug :: LogLevel +levelDebug = LG.LevelDebug + +-- * Level Filter + +minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool +minLevelFilter l _ l' = l' >= l + +infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool +infoLevelFilter = minLevelFilter LG.LevelInfo diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache index 028941e3ae7..1b1db613a2d 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache @@ -75,7 +75,8 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | {{{generateLenses}}} | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{{generateModelConstructors}}} | | modelDeriving | Additional classes to include in the deriving() clause of Models | | {{{modelDeriving}}} | -| strictFields | Add strictness annotations to all model fields | false | {{{x-strictFields}}} | +| strictFields | Add strictness annotations to all model fields | true | {{{x-strictFields}}} | +| useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | {{{x-useMonadLogger}}} | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -115,6 +116,7 @@ This library is intended to be imported qualified. | {{title}}.Model | describes models | | {{title}}.MimeTypes | encoding/decoding MIME types (content-types/accept) | | {{title}}.Lens | lenses for model fields | +| {{title}}.Logging | logging functions and utils | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache index 3cbf6cd3630..83e2c8ed979 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache @@ -8,6 +8,7 @@ module {{title}} , module {{title}}.Model , module {{title}}.MimeTypes , module {{title}}.Lens + , module {{title}}.Logging ) where import {{title}}.API @@ -15,3 +16,4 @@ import {{title}}.Client import {{title}}.Model import {{title}}.MimeTypes import {{title}}.Lens +import {{title}}.Logging diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache index 0f1f9f28a6a..c572b6458d2 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache @@ -33,7 +33,7 @@ extra-source-files: library hs-source-dirs: lib - ghc-options: -Wall + ghc-options: -Wall -funbox-strict-fields build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 @@ -54,7 +54,7 @@ library , network >=2.6.2 && <2.7 , random >=1.1 , exceptions >= 0.4 - , monad-logger >=0.3 && <0.4 + , {{^x-useMonadLogger}}katip >=0.4 && < 0.6{{/x-useMonadLogger}}{{#x-useMonadLogger}}monad-logger >=0.3 && <0.4{{/x-useMonadLogger}} , safe-exceptions <0.2 , case-insensitive , microlens >= 0.4.3 && <0.5 @@ -65,6 +65,7 @@ library {{title}}.Model {{title}}.MimeTypes {{title}}.Lens + {{title}}.Logging other-modules: Paths_{{pathsName}} default-language: Haskell2010 @@ -74,7 +75,7 @@ test-suite tests main-is: Test.hs hs-source-dirs: tests - ghc-options: -fno-warn-orphans + ghc-options: -Wall -fno-warn-orphans build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache index 23b18b7c6ce..792fc6501f7 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache @@ -48,6 +48,7 @@ library: - {{title}}.Model - {{title}}.MimeTypes - {{title}}.Lens + - {{title}}.Logging dependencies: - aeson >=1.0 && <2.0 - bytestring >=0.10.0 && <0.11 @@ -64,7 +65,7 @@ library: - network >=2.6.2 && <2.7 - random >=1.1 - exceptions >= 0.4 - - monad-logger >=0.3 && <0.4 + - {{^x-useMonadLogger}}katip >=0.4 && < 0.6{{/x-useMonadLogger}}{{#x-useMonadLogger}}monad-logger >=0.3 && <0.4{{/x-useMonadLogger}} - safe-exceptions <0.2 - case-insensitive - microlens >= 0.4.3 && <0.5 diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java index 98d583fbd11..fbd99027bfd 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java @@ -49,6 +49,8 @@ protected void setExpectations() { times = 1; clientCodegen.setStrictFields(Boolean.valueOf(HaskellHttpClientOptionsProvider.STRICT_FIELDS)); times = 1; + clientCodegen.setUseMonadLogger(Boolean.valueOf(HaskellHttpClientOptionsProvider.USE_MONAD_LOGGER)); + times = 1; }}; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java index d124c66ff54..4695069a53d 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java @@ -23,6 +23,7 @@ public class HaskellHttpClientOptionsProvider implements OptionsProvider { public static final String GENERATE_FORM_URLENCODED_INSTANCES = "true"; public static final String GENERATE_LENSES = "true"; public static final String GENERATE_MODEL_CONSTRUCTORS = "true"; + public static final String USE_MONAD_LOGGER = "false"; @Override public String getLanguage() { @@ -48,6 +49,7 @@ public Map createOptions() { .put(HaskellHttpClientCodegen.GENERATE_LENSES, GENERATE_LENSES) .put(HaskellHttpClientCodegen.GENERATE_MODEL_CONSTRUCTORS, GENERATE_MODEL_CONSTRUCTORS) .put(HaskellHttpClientCodegen.STRICT_FIELDS, STRICT_FIELDS) + .put(HaskellHttpClientCodegen.USE_MONAD_LOGGER, USE_MONAD_LOGGER) .build(); } diff --git a/samples/client/petstore/haskell-http-client/CONTRIBUTING.md b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md index 91fbe58305b..4d86a160843 100644 --- a/samples/client/petstore/haskell-http-client/CONTRIBUTING.md +++ b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md @@ -17,9 +17,10 @@ 2. Check that the following commands complete build without any errors ```bash - (stack clean && stack haddock && stack test); - (cd ./example-app; stack clean && stack build); - (cd ./tests-integration; stack clean && stack build --no-run-tests); + (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); + (stack haddock && stack test); + (cd ./example-app; stack build); + (cd ./tests-integration; stack build --no-run-tests); ``` ### Integration Tests diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 35ac99a323a..cfbe72747d8 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -75,7 +75,8 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | true | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true | | modelDeriving | Additional classes to include in the deriving() clause of Models | | | -| strictFields | Add strictness annotations to all model fields | false | false | +| strictFields | Add strictness annotations to all model fields | true | true | +| useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | false | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -115,6 +116,7 @@ This library is intended to be imported qualified. | SwaggerPetstore.Model | describes models | | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) | | SwaggerPetstore.Lens | lenses for model fields | +| SwaggerPetstore.Logging | logging functions and utils | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index 5be560eab09..54087571b77 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

configExecLoggingT: runNullLoggingT

configLoggingFilter: infoLevelFilter

withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stdout.

withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stderr.

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

type ExecLoggingT = forall m. MonadIO m => forall a. LoggingT m a -> m a Source #

A block using a MonadLogger instance

Null Logger

nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () Source #

a logger which disables logging

runNullLoggingT :: LoggingT m a -> m a Source #

run the monad transformer that disables logging

Logging Filters

errorLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelError as the minimum logging level

infoLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelInfo as the minimum logging level

debugLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelDebug as the minimum logging level

Logging

logNST :: (MonadIO m, MonadLogger m) => LogLevel -> Text -> Text -> m () Source #

Log a message using the current time

logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT Source #

Run a block using the configured MonadLogger instance

runExceptionLoggingT :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LoggingT m a -> m a Source #

Run a block using the configured MonadLogger instance (logs exceptions)

\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: IO SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Logging.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Logging.html new file mode 100644 index 00000000000..b99e0a66fba --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Logging.html @@ -0,0 +1,4 @@ +SwaggerPetstore.Logging

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Logging

Description

Katip Logging functions

Type Aliases (for compatability)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a Katip logging block with the Log environment

type LogExec m = forall a. KatipT m a -> m a Source #

A Katip logging block

type LogContext = LogEnv Source #

A Katip Log environment

type LogLevel = Severity Source #

A Katip Log severity

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdoutLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stdout

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stderrLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stderr

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables Katip logging

Log Msg

_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () Source #

Log a katip message

Log Exceptions

logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html index e54d8c2a3d3..2e94ca821d5 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source # 
FromJSON Order Source # 
HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source # 
FromJSON Pet Source # 
HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

a User

A User who is purchasing from the pet store

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

DateTime Formatting

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

Date Formatting

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Synopsis

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source # 
FromJSON Order Source # 
HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source # 
FromJSON Pet Source # 
HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

a User

A User who is purchasing from the pet store

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

DateTime Formatting

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

Date Formatting

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html index 6ae120a6311..31238fe42e7 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html @@ -1,4 +1,4 @@ SwaggerPetstore

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html b/samples/client/petstore/haskell-http-client/docs/doc-index-45.html index bc2e69901ea..b075b316c57 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-45.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - -)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - -

-&-SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - -

-&-SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index f05689deb6e..7c4ba0203b2 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - _)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html index b27a47d654f..0c70842879e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - A)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - A

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - A

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html index 32f2de0df2e..01798755240 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index

-&-SwaggerPetstore.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, SwaggerPetstore
DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index

-&-SwaggerPetstore.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html index 863fdeaafeb..e50148774b0 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - C)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - C

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - C

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html index b2d4af4309e..50baaa0befa 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - D)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - D

debugLevelFilterSwaggerPetstore.Client, SwaggerPetstore
DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - D

DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-E.html b/samples/client/petstore/haskell-http-client/docs/doc-index-E.html deleted file mode 100644 index a656d616cba..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-E.html +++ /dev/null @@ -1,4 +0,0 @@ -swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - E)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - E

errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-F.html b/samples/client/petstore/haskell-http-client/docs/doc-index-F.html index 41aed3abf04..07d76cf97de 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-F.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-F.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - F)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - F

File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - F

File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-G.html b/samples/client/petstore/haskell-http-client/docs/doc-index-G.html index ba44a64e37d..1d4374339f9 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-G.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-G.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - G)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - G

GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - G

GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html index 907c42532e2..81e4217389e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - H)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html index cda6ec29fe0..b190c9d63e1 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - I)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - I

infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - I

initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-L.html b/samples/client/petstore/haskell-http-client/docs/doc-index-L.html index 800469ab06e..34300a382d5 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-L.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-L.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - L)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - L

Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - L

Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html index d1f062a7a9a..bfc39c25bc2 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - M)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - M

MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - M

MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html index 46e938dcc57..09dd3efbb76 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - N)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - N

Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - N

Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-O.html b/samples/client/petstore/haskell-http-client/docs/doc-index-O.html index cef8bb7a96d..78a8242a188 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-O.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-O.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - O)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - O

Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - O

Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html index 49fe76696ca..60ab39ed038 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - P)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - P

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - P

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 37efd6d0758..0c476d5eb64 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-S.html b/samples/client/petstore/haskell-http-client/docs/doc-index-S.html index 64ec100e604..edbcbd89f67 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-S.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-S.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - S)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html index a918a451f03..224de1d846b 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - T)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html index dd47647ad7d..f83238befbf 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - U)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html index b30049c4ec8..4db5785b8f0 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - W)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index.html b/samples/client/petstore/haskell-http-client/docs/doc-index.html index 93b48705f11..d1c15e2898d 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/index.html b/samples/client/petstore/haskell-http-client/docs/index.html index 07839448e85..828f1906ded 100644 --- a/samples/client/petstore/haskell-http-client/docs/index.html +++ b/samples/client/petstore/haskell-http-client/docs/index.html @@ -3,4 +3,4 @@ //]]>

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

. Client library for calling the swagger-petstore API based on http-client. -host: petstore.swagger.io

base path: http://petstore.swagger.io/v2

apiVersion: 0.0.1

swagger version: 2.0

OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

\ No newline at end of file +host: petstore.swagger.io

base path: http://petstore.swagger.io/v2

apiVersion: 0.0.1

swagger version: 2.0

OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

Modules

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html index 9f32380e5d4..fc5f19bb9ee 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

SwaggerPetstore.Client

Config

Dispatch

Lbs

Mime

data MimeResult res

Unsafe

InitRequest

data InitRequest req contentType res accept

Logging

Null Logger

Logging Filters

Logging

\ No newline at end of file +

SwaggerPetstore.Client

Config

Dispatch

Lbs

Mime

data MimeResult res

Unsafe

InitRequest

data InitRequest req contentType res accept

Logging

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html new file mode 100644 index 00000000000..3e0e32d8dd4 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html @@ -0,0 +1,4 @@ +SwaggerPetstore.Logging

SwaggerPetstore.Logging

Type Aliases (for compatability)

type LogExec m

default logger

stdout logger

stderr logger

Null logger

Log Msg

Log Exceptions

Log Level

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 9f192a77a35..5698d1fe765 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -30,7 +30,7 @@ bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/bin" -libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-CY2qj9sV8yi3N5R3aev4xa" +libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-Kuz5nG0AYvXTOw4CQ9HS" dynlibdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2" datadir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/share/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0" libexecdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/libexec" @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html index 2f8e8d83d05..6bffe8754f0 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html @@ -83,13 +83,13 @@ -- Note: Has 'Produces' instances, but no response schema -- addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = _mkRequest "POST" ["/pet"] - `setBodyParam` body + `setBodyParam` body data AddPet @@ -121,15 +121,15 @@ -- deletePet :: Integer -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = - _mkRequest "DELETE" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +deletePet petId = + _mkRequest "DELETE" ["/pet/",toPath petId] data DeletePet instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey xs) = - req `setHeader` toHeader ("api_key", xs) + applyOptionalParam req (ApiUnderscorekey xs) = + req `setHeader` toHeader ("api_key", xs) -- | @application/xml@ instance Produces DeletePet MimeXML -- | @application/json@ @@ -149,9 +149,9 @@ findPetsByStatus :: [Text] -- ^ "status" - Status values that need to be considered for filter -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = +findPetsByStatus status = _mkRequest "GET" ["/pet/findByStatus"] - `_setQuery` toQueryColl CommaSeparated ("status", Just status) + `_setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -173,9 +173,9 @@ findPetsByTags :: [Text] -- ^ "tags" - Tags to filter by -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = +findPetsByTags tags = _mkRequest "GET" ["/pet/findByTags"] - `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -199,8 +199,8 @@ getPetById :: Integer -- ^ "petId" - ID of pet to return -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = - _mkRequest "GET" ["/pet/",toPath petId] +getPetById petId = + _mkRequest "GET" ["/pet/",toPath petId] data GetPetById @@ -223,13 +223,13 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = + -> SwaggerPetstoreRequest UpdatePet contentType res +updatePet _ body = _mkRequest "PUT" ["/pet"] - `setBodyParam` body + `setBodyParam` body data UpdatePet @@ -260,25 +260,25 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = - _mkRequest "POST" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ petId = + _mkRequest "POST" ["/pet/",toPath petId] data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = - req `_addForm` toForm ("name", xs) + applyOptionalParam req (Name xs) = + req `_addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status xs) = - req `_addForm` toForm ("status", xs) + applyOptionalParam req (Status xs) = + req `_addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -300,25 +300,25 @@ -- AuthMethod: petstore_auth -- uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +uploadFile _ petId = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] data UploadFile -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server instance HasOptionalParam UploadFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | /Optional Param/ "file" - file to upload instance HasOptionalParam UploadFile File where - applyOptionalParam req (File xs) = - req `_addMultiFormPart` NH.partFileSource "file" xs + applyOptionalParam req (File xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ instance Consumes UploadFile MimeMultipartFormData @@ -341,9 +341,9 @@ -- deleteOrder :: Text -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder orderId = - _mkRequest "DELETE" ["/store/order/",toPath orderId] + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +deleteOrder orderId = + _mkRequest "DELETE" ["/store/order/",toPath orderId] data DeleteOrder @@ -384,8 +384,8 @@ getOrderById :: Integer -- ^ "orderId" - ID of pet that needs to be fetched -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById orderId = - _mkRequest "GET" ["/store/order/",toPath orderId] +getOrderById orderId = + _mkRequest "GET" ["/store/order/",toPath orderId] data GetOrderById @@ -404,13 +404,13 @@ -- -- placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => contentType -- ^ request content-type ('MimeType') -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -placeOrder _ body = + -> SwaggerPetstoreRequest PlaceOrder contentType Order +placeOrder _ body = _mkRequest "POST" ["/store/order"] - `setBodyParam` body + `setBodyParam` body data PlaceOrder @@ -435,13 +435,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -createUser _ body = + -> SwaggerPetstoreRequest CreateUser contentType res +createUser _ body = _mkRequest "POST" ["/user"] - `setBodyParam` body + `setBodyParam` body data CreateUser @@ -464,13 +464,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +createUsersWithArrayInput _ body = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithArrayInput @@ -493,13 +493,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +createUsersWithListInput _ body = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithListInput @@ -523,9 +523,9 @@ -- deleteUser :: Text -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser username = - _mkRequest "DELETE" ["/user/",toPath username] + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser username = + _mkRequest "DELETE" ["/user/",toPath username] data DeleteUser @@ -546,8 +546,8 @@ getUserByName :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName username = - _mkRequest "GET" ["/user/",toPath username] +getUserByName username = + _mkRequest "GET" ["/user/",toPath username] data GetUserByName @@ -569,10 +569,10 @@ :: Text -- ^ "username" - The user name for login -> Text -- ^ "password" - The password for login in clear text -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username password = +loginUser username password = _mkRequest "GET" ["/user/login"] - `_setQuery` toQuery ("username", Just username) - `_setQuery` toQuery ("password", Just password) + `_setQuery` toQuery ("username", Just username) + `_setQuery` toQuery ("password", Just password) data LoginUser -- | @application/xml@ @@ -592,7 +592,7 @@ -- Note: Has 'Produces' instances, but no response schema -- logoutUser - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res logoutUser = _mkRequest "GET" ["/user/logout"] @@ -614,15 +614,15 @@ -- Note: Has 'Produces' instances, but no response schema -- updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> Text -- ^ "username" - name that need to be deleted -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ username body = - _mkRequest "PUT" ["/user/",toPath username] + -> SwaggerPetstoreRequest UpdateUser contentType res +updateUser _ username body = + _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body + `setBodyParam` body data UpdateUser @@ -638,25 +638,25 @@ -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader -- * HasOptionalParam -- | Designates the optional parameters of a request -class HasOptionalParam req param where +class HasOptionalParam req param where {-# MINIMAL applyOptionalParam | (-&-) #-} -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -678,7 +678,7 @@ -- * SwaggerPetstoreRequest -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , rParams :: Params -- ^ params of SwaggerPetstoreRequest @@ -686,18 +686,18 @@ deriving (P.Show) -- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod {-# INLINE rMethodL #-} -- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath {-# INLINE rUrlPathL #-} -- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} -- | Request Params @@ -710,17 +710,17 @@ -- | 'paramsQuery' Lens paramsQueryL :: Lens_' Params NH.Query -paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery {-# INLINE paramsQueryL #-} -- | 'paramsHeaders' Lens paramsHeadersL :: Lens_' Params NH.RequestHeaders -paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders {-# INLINE paramsHeadersL #-} -- | 'paramsBody' Lens paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody {-# INLINE paramsBodyL #-} -- | Request Body @@ -736,87 +736,87 @@ _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + req & L.over (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of - Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["content-type"] +_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_setContentTypeHeader req = + case mimeType (P.Proxy :: P.Proxy contentType) of + Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["content-type"] -_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = - req & +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_setQuery req query = + req & L.over (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -- ** Params Utils toPath - :: WH.ToHttpApiData a - => a -> BCL.ByteString + :: WH.ToHttpApiData a + => a -> BCL.ByteString toPath = BB.toLazyByteString . WH.toEncodedUrlPiece -toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] -toHeader x = [fmap WH.toHeader x] +toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] +toHeader x = [fmap WH.toHeader x] -toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form -toForm (k,v) = WH.toForm [(BC.unpack k,v)] +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] -toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] -toQuery x = [(fmap . fmap) toQueryParam x] - where toQueryParam = T.encodeUtf8 . WH.toQueryParam +toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] +toQuery x = [(fmap . fmap) toQueryParam x] + where toQueryParam = T.encodeUtf8 . WH.toQueryParam -- *** Swagger `CollectionFormat` Utils @@ -828,38 +828,38 @@ | PipeSeparated -- ^ `value1|value2|value2` | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form') -toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] -toHeaderColl c xs = _toColl c toHeader xs +toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] +toHeaderColl c xs = _toColl c toHeader xs -toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form -toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs +toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form +toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs where - pack (k,v) = (CI.mk k, v) - unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) -toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query -toQueryColl c xs = _toCollA c toQuery xs +toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query +toQueryColl c xs = _toCollA c toQuery xs -_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] -_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) - where fencode = fmap (fmap Just) . encode . fmap P.fromJust +_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] +_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) + where fencode = fmap (fmap Just) . encode . fmap P.fromJust {-# INLINE fencode #-} -_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] -_toCollA c encode xs = _toCollA' c encode BC.singleton xs +_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] +_toCollA c encode xs = _toCollA' c encode BC.singleton xs -_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] -_toCollA' c encode one xs = case c of - CommaSeparated -> go (one ',') - SpaceSeparated -> go (one ' ') - TabSeparated -> go (one '\t') - PipeSeparated -> go (one '|') - MultiParamArray -> expandList +_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] +_toCollA' c encode one xs = case c of + CommaSeparated -> go (one ',') + SpaceSeparated -> go (one ' ') + TabSeparated -> go (one '\t') + PipeSeparated -> go (one '|') + MultiParamArray -> expandList where - go sep = - [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] - combine sep x y = x <> sep <> y - expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs + go sep = + [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] + combine sep x y = x <> sep <> y + expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html index e8979eb697f..1322b6658ca 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html @@ -17,302 +17,249 @@ import SwaggerPetstore.Model import SwaggerPetstore.API import SwaggerPetstore.MimeTypes - -import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A -import qualified Data.Aeson.Types as A -import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Control.Monad.Logger as LG - -import qualified Data.Time as TI -import qualified Data.Map as Map -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB -import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH -import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH - -import qualified Control.Exception.Safe as E --- * Config - --- | -data SwaggerPetstoreConfig = SwaggerPetstoreConfig - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. - } - --- | display the config -instance Show SwaggerPetstoreConfig where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default SwaggerPetstoreConfig --- --- configHost: --- --- @http://petstore.swagger.io/v2@ --- --- configUserAgent: --- --- @"swagger-haskell-http-client/1.0.0"@ --- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: SwaggerPetstoreConfig -newConfig = - SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} - --- | updates the config to disable logging -withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} - --- * Dispatch - --- ** Lbs - --- | send a request returning the raw http response -dispatchLbs - :: (Produces req accept, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- ** Mime - --- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response - } - deriving (Show, Functor, Foldable, Traversable) - --- | pair of unrender/parser error and http response -data MimeError = - MimeError { - mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response - } deriving (Eq, Show) - --- | send a request returning the 'MimeResult' -dispatchMime - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runExceptionLoggingT "Client" config $ - do case mimeUnrender' accept (NH.responseBody httpResponse) of - Left s -> do - logNST LG.LevelError "Client" (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) - --- | like 'dispatchMime', but only returns the decoded http body -dispatchMime' - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - return parsedResult - --- ** Unsafe - --- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) -dispatchLbsUnsafe - :: (MimeType accept, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- | dispatch an InitRequest -dispatchInitUnsafe - :: NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> InitRequest req contentType res accept -- ^ init request - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) - return res - where - logSrc = "Client" - endpoint = - T.pack $ - BC.unpack $ - NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req - requestLogMsg = "REQ:" <> endpoint - requestDbgLogMsg = - "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> - (case NH.requestBody req of - NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) - _ -> "<RequestBody>") - responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus - responseLogMsg res = - "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" - --- * InitRequest - --- | wraps an http-client 'Request' with request/response type parameters -newtype InitRequest req contentType res accept = InitRequest - { unInitRequest :: NH.Request - } deriving (Show) - --- | Build an http-client 'Request' record from the supplied config and request -_toInitRequest - :: (MimeType accept, MimeType contentType) - => SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) of - ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) - ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) - ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) - ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) - ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq - - pure (InitRequest outReq) - --- | modify the underlying Request -modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept -modifyInitRequest (InitRequest req) f = InitRequest (f req) - --- | modify the underlying Request (monadic) -modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) -modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) - --- * Logging - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - --- ** Logging - --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc - \ No newline at end of file +import SwaggerPetstore.Logging + +import qualified Control.Monad.IO.Class as P +import qualified Data.Aeson as A +import qualified Data.Aeson.Types as A +import qualified Data.Proxy as P (Proxy(..)) +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) +import Web.FormUrlEncoded as WH +import Web.HttpApiData as WH +import Control.Monad.Catch (MonadThrow) + +import qualified Data.Time as TI +import qualified Data.Map as Map +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Text.Printf as T + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Builder as BB +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Client.TLS as NH +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types.Method as NH +import qualified Network.HTTP.Types as NH +import qualified Network.HTTP.Types.URI as NH + +import qualified Control.Exception.Safe as E +-- * Config + +-- | +data SwaggerPetstoreConfig = SwaggerPetstoreConfig + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + } + +-- | display the config +instance Show SwaggerPetstoreConfig where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default SwaggerPetstoreConfig +-- +-- configHost: +-- +-- @http://petstore.swagger.io/v2@ +-- +-- configUserAgent: +-- +-- @"swagger-haskell-http-client/1.0.0"@ +-- +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } + +-- | updates the config to disable logging +withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig +withNoLogging p = p { configLogExecWithContext = runNullLogExec} + +-- * Dispatch + +-- ** Lbs + +-- | send a request returning the raw http response +dispatchLbs + :: (Produces req accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- ** Mime + +-- | pair of decoded http body and http response +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + } + deriving (Show, Functor, Foldable, Traversable) + +-- | pair of unrender/parser error and http response +data MimeError = + MimeError { + mimeError :: String -- ^ unrender/parser error + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + } deriving (Eq, Show) + +-- | send a request returning the 'MimeResult' +dispatchMime + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' accept (NH.responseBody httpResponse) of + Left s -> do + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + Right r -> pure (Right r) + return (MimeResult parsedResult httpResponse) + +-- | like 'dispatchMime', but only returns the decoded http body +dispatchMime' + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + return parsedResult + +-- ** Unsafe + +-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) +dispatchLbsUnsafe + :: (MimeType accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> InitRequest req contentType res accept -- ^ init request + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchInitUnsafe manager config (InitRequest req) = do + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) + return res + where + src = "Client" + endpoint = + T.pack $ + BC.unpack $ + NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req + requestLogMsg = "REQ:" <> endpoint + requestDbgLogMsg = + "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> + (case NH.requestBody req of + NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) + _ -> "<RequestBody>") + responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus + responseLogMsg res = + "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" + +-- * InitRequest + +-- | wraps an http-client 'Request' with request/response type parameters +newtype InitRequest req contentType res accept = InitRequest + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery + } + outReq <- case paramsBody (rParams req1) of + ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) + ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) + ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) + ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) + ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq + + pure (InitRequest outReq) + +-- | modify the underlying Request +modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept +modifyInitRequest (InitRequest req) f = InitRequest (f req) + +-- | modify the underlying Request (monadic) +modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) +modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: P.MonadIO m + => SwaggerPetstoreConfig -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) + +-- | Run a block using the configured logger instance (logs exceptions) +runConfigLogWithExceptions + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> SwaggerPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 72210d62f14..eddc4581818 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -29,25 +29,25 @@ -- * Type Aliases -type Lens_' s a = Lens_ s s a a -type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t +type Lens_' s a = Lens_ s s a a +type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t -- * ApiResponse -- | 'apiResponseCode' Lens apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode {-# INLINE apiResponseCodeL #-} -- | 'apiResponseType' Lens apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) -apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType {-# INLINE apiResponseTypeL #-} -- | 'apiResponseMessage' Lens apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage {-# INLINE apiResponseMessageL #-} @@ -56,12 +56,12 @@ -- | 'categoryId' Lens categoryIdL :: Lens_' Category (Maybe Integer) -categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId {-# INLINE categoryIdL #-} -- | 'categoryName' Lens categoryNameL :: Lens_' Category (Maybe Text) -categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName {-# INLINE categoryNameL #-} @@ -70,32 +70,32 @@ -- | 'orderId' Lens orderIdL :: Lens_' Order (Maybe Integer) -orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId {-# INLINE orderIdL #-} -- | 'orderPetId' Lens orderPetIdL :: Lens_' Order (Maybe Integer) -orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId {-# INLINE orderPetIdL #-} -- | 'orderQuantity' Lens orderQuantityL :: Lens_' Order (Maybe Int) -orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity {-# INLINE orderQuantityL #-} -- | 'orderShipDate' Lens orderShipDateL :: Lens_' Order (Maybe UTCTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} -- | 'orderStatus' Lens orderStatusL :: Lens_' Order (Maybe Text) -orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus {-# INLINE orderStatusL #-} -- | 'orderComplete' Lens orderCompleteL :: Lens_' Order (Maybe Bool) -orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete {-# INLINE orderCompleteL #-} @@ -104,32 +104,32 @@ -- | 'petId' Lens petIdL :: Lens_' Pet (Maybe Integer) -petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId {-# INLINE petIdL #-} -- | 'petCategory' Lens petCategoryL :: Lens_' Pet (Maybe Category) -petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory {-# INLINE petCategoryL #-} -- | 'petName' Lens petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName {-# INLINE petNameL #-} -- | 'petPhotoUrls' Lens petPhotoUrlsL :: Lens_' Pet ([Text]) -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls +petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls {-# INLINE petPhotoUrlsL #-} -- | 'petTags' Lens petTagsL :: Lens_' Pet (Maybe [Tag]) -petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags {-# INLINE petTagsL #-} -- | 'petStatus' Lens petStatusL :: Lens_' Pet (Maybe Text) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus {-# INLINE petStatusL #-} @@ -138,12 +138,12 @@ -- | 'tagId' Lens tagIdL :: Lens_' Tag (Maybe Integer) -tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId {-# INLINE tagIdL #-} -- | 'tagName' Lens tagNameL :: Lens_' Tag (Maybe Text) -tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName {-# INLINE tagNameL #-} @@ -152,42 +152,42 @@ -- | 'userId' Lens userIdL :: Lens_' User (Maybe Integer) -userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId {-# INLINE userIdL #-} -- | 'userUsername' Lens userUsernameL :: Lens_' User (Maybe Text) -userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername {-# INLINE userUsernameL #-} -- | 'userFirstName' Lens userFirstNameL :: Lens_' User (Maybe Text) -userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName {-# INLINE userFirstNameL #-} -- | 'userLastName' Lens userLastNameL :: Lens_' User (Maybe Text) -userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName {-# INLINE userLastNameL #-} -- | 'userEmail' Lens userEmailL :: Lens_' User (Maybe Text) -userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail {-# INLINE userEmailL #-} -- | 'userPassword' Lens userPasswordL :: Lens_' User (Maybe Text) -userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword {-# INLINE userPasswordL #-} -- | 'userPhone' Lens userPhoneL :: Lens_' User (Maybe Text) -userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone {-# INLINE userPhoneL #-} -- | 'userUserStatus' Lens userUserStatusL :: Lens_' User (Maybe Int) -userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus {-# INLINE userUserStatusL #-} diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html new file mode 100644 index 00000000000..8df26c2340a --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -0,0 +1,109 @@ +
{-|
+Module : SwaggerPetstore.Logging
+Katip Logging functions
+-}
+
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module SwaggerPetstore.Logging where
+
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
+
+import qualified Control.Exception.Safe as E
+import qualified Control.Monad.IO.Class as P
+import qualified Control.Monad.Trans.Reader as P
+import qualified Data.Text as T
+import qualified Lens.Micro as L
+import qualified System.IO as IO
+
+import qualified Katip as LG
+
+-- * Type Aliases (for compatability)
+
+-- | Runs a Katip logging block with the Log environment
+type LogExecWithContext = forall m. P.MonadIO m =>
+                                    LogContext -> LogExec m
+
+-- | A Katip logging block
+type LogExec m = forall a. LG.KatipT m a -> m a
+
+-- | A Katip Log environment
+type LogContext = LG.LogEnv
+
+-- | A Katip Log severity
+type LogLevel = LG.Severity
+
+-- * default logger
+
+-- | the default log environment
+initLogContext :: IO LogContext
+initLogContext = LG.initLogEnv "SwaggerPetstore" "dev"
+
+-- | Runs a Katip logging block with the Log environment
+runDefaultLogExecWithContext :: LogExecWithContext
+runDefaultLogExecWithContext = LG.runKatipT
+
+-- * stdout logger
+
+-- | Runs a Katip logging block with the Log environment
+stdoutLoggingExec :: LogExecWithContext
+stdoutLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stdout
+stdoutLoggingContext :: LogContext -> IO LogContext
+stdoutLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2
+    LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
+
+-- * stderr logger
+
+-- | Runs a Katip logging block with the Log environment
+stderrLoggingExec :: LogExecWithContext
+stderrLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stderr
+stderrLoggingContext :: LogContext -> IO LogContext
+stderrLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
+    LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
+
+-- * Null logger
+
+-- | Disables Katip logging
+runNullLogExec :: LogExecWithContext
+runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
+
+-- * Log Msg
+
+-- | Log a katip message
+_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
+_log src level msg = do
+  LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
+
+-- * Log Exceptions
+
+-- | re-throws exceptions after logging them
+logExceptions
+  :: (LG.Katip m, E.MonadCatch m, Applicative m)
+  => Text -> m a -> m a
+logExceptions src =
+  E.handle
+    (\(e :: E.SomeException) -> do
+       _log src LG.ErrorS ((T.pack . show) e)
+       E.throw e)
+
+-- * Log Level
+
+levelInfo :: LogLevel
+levelInfo = LG.InfoS
+
+levelError :: LogLevel
+levelError = LG.ErrorS
+
+levelDebug :: LogLevel
+levelDebug = LG.DebugS
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html index cec9866dffa..42836733cfd 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html @@ -54,94 +54,94 @@
-- ** MimeType Class -class P.Typeable mtype => MimeType mtype where +class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} - mimeTypes :: P.Proxy mtype -> [ME.MediaType] - mimeTypes p = - case mimeType p of - Just x -> [x] + mimeTypes :: P.Proxy mtype -> [ME.MediaType] + mimeTypes p = + case mimeType p of + Just x -> [x] Nothing -> [] - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of [] -> Nothing - (x:_) -> Just x + (x:_) -> Just x - mimeType' :: mtype -> Maybe ME.MediaType - mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) - mimeTypes' :: mtype -> [ME.MediaType] - mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) -- ** MimeType Instances -- | @application/json@ instance MimeType MimeJSON where - mimeTypes _ = + mimeTypes _ = [ "application" ME.// "json" ME./: ("charset", "utf-8") , "application" ME.// "json" ] -- | @application/xml@ instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" + mimeType _ = Just $ "application" ME.// "xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" + mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" + mimeType _ = Just $ "multipart" ME.// "form-data" -- | @text/plain;charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") + mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" + mimeType _ = Just $ "application" ME.// "octet-stream" instance MimeType MimeNoContent where - mimeType _ = Nothing + mimeType _ = Nothing -- ** MimeRender Class -class MimeType mtype => MimeRender mtype x where - mimeRender :: P.Proxy mtype -> x -> BL.ByteString - mimeRender' :: mtype -> x -> BL.ByteString - mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeRender mtype x where + mimeRender :: P.Proxy mtype -> x -> BL.ByteString + mimeRender' :: mtype -> x -> BL.ByteString + mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x -- ** MimeRender Instances -- | `A.encode` -instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode +instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode -- | @WH.urlEncodeAsForm@ -instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm +instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm -- | @P.id@ -instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack -- | @P.id@ -instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack -- | @P.id@ -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack -- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty -- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec -- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec @@ -151,41 +151,41 @@ -- ** MimeUnrender Class -class MimeType mtype => MimeUnrender mtype o where - mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o - mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o - mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeUnrender mtype o where + mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o + mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o + mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x -- ** MimeUnrender Instances -- | @A.eitherDecode@ -instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode +instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode -- | @P.left T.unpack . WH.urlDecodeAsForm@ -instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm +instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm -- | @P.Right . P.id@ -instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . TL.decodeUtf8'@ -instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.id@ -instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . T.decodeUtf8' . BL.toStrict@ -instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent -- ** Request Consumes -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- ** Request Produces -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html index ebdc681521a..f7d6ec052bb 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html @@ -52,24 +52,24 @@ -- -- Describes the result of uploading an image resource data ApiResponse = ApiResponse - { apiResponseCode :: Maybe Int -- ^ "code" - , apiResponseType :: Maybe Text -- ^ "type" - , apiResponseMessage :: Maybe Text -- ^ "message" + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> + parseJSON = A.withObject "ApiResponse" $ \o -> ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") instance A.ToJSON ApiResponse where - toJSON ApiResponse {..} = + toJSON ApiResponse {..} = _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage ] @@ -91,21 +91,21 @@ -- -- A category for a pet data Category = Category - { categoryId :: Maybe Integer -- ^ "id" - , categoryName :: Maybe Text -- ^ "name" + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> + parseJSON = A.withObject "Category" $ \o -> Category - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") instance A.ToJSON Category where - toJSON Category {..} = + toJSON Category {..} = _omitNulls - [ "id" .= categoryId - , "name" .= categoryName + [ "id" .= categoryId + , "name" .= categoryName ] @@ -126,33 +126,33 @@ -- -- An order for a pets from the pet store data Order = Order - { orderId :: Maybe Integer -- ^ "id" - , orderPetId :: Maybe Integer -- ^ "petId" - , orderQuantity :: Maybe Int -- ^ "quantity" - , orderShipDate :: Maybe UTCTime -- ^ "shipDate" - , orderStatus :: Maybe Text -- ^ "status" - Order Status - , orderComplete :: Maybe Bool -- ^ "complete" + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" + , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> + parseJSON = A.withObject "Order" $ \o -> Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate" >>= P.mapM _readDateTime) - <*> (o .:? "status") - <*> (o .:? "complete") + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate" >>= P.mapM _readDateTime) + <*> (o .:? "status") + <*> (o .:? "complete") instance A.ToJSON Order where - toJSON Order {..} = + toJSON Order {..} = _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= P.fmap _showDateTime orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= P.fmap _showDateTime orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete ] @@ -177,33 +177,33 @@ -- -- A pet for sale in the pet store data Pet = Pet - { petId :: Maybe Integer -- ^ "id" - , petCategory :: Maybe Category -- ^ "category" - , petName :: Text -- ^ /Required/ "name" - , petPhotoUrls :: [Text] -- ^ /Required/ "photoUrls" - , petTags :: Maybe [Tag] -- ^ "tags" - , petStatus :: Maybe Text -- ^ "status" - pet status in the store + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> + parseJSON = A.withObject "Pet" $ \o -> Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") instance A.ToJSON Pet where - toJSON Pet {..} = + toJSON Pet {..} = _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus ] @@ -212,12 +212,12 @@ :: Text -- ^ 'petName' -> [Text] -- ^ 'petPhotoUrls' -> Pet -mkPet petName petPhotoUrls = +mkPet petName petPhotoUrls = Pet { petId = Nothing , petCategory = Nothing - , petName - , petPhotoUrls + , petName + , petPhotoUrls , petTags = Nothing , petStatus = Nothing } @@ -230,21 +230,21 @@ -- -- A tag for a pet data Tag = Tag - { tagId :: Maybe Integer -- ^ "id" - , tagName :: Maybe Text -- ^ "name" + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> + parseJSON = A.withObject "Tag" $ \o -> Tag - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") instance A.ToJSON Tag where - toJSON Tag {..} = + toJSON Tag {..} = _omitNulls - [ "id" .= tagId - , "name" .= tagName + [ "id" .= tagId + , "name" .= tagName ] @@ -265,39 +265,39 @@ -- -- A User who is purchasing from the pet store data User = User - { userId :: Maybe Integer -- ^ "id" - , userUsername :: Maybe Text -- ^ "username" - , userFirstName :: Maybe Text -- ^ "firstName" - , userLastName :: Maybe Text -- ^ "lastName" - , userEmail :: Maybe Text -- ^ "email" - , userPassword :: Maybe Text -- ^ "password" - , userPhone :: Maybe Text -- ^ "phone" - , userUserStatus :: Maybe Int -- ^ "userStatus" - User Status + { userId :: !(Maybe Integer) -- ^ "id" + , userUsername :: !(Maybe Text) -- ^ "username" + , userFirstName :: !(Maybe Text) -- ^ "firstName" + , userLastName :: !(Maybe Text) -- ^ "lastName" + , userEmail :: !(Maybe Text) -- ^ "email" + , userPassword :: !(Maybe Text) -- ^ "password" + , userPhone :: !(Maybe Text) -- ^ "phone" + , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON User where - parseJSON = A.withObject "User" $ \o -> + parseJSON = A.withObject "User" $ \o -> User - <$> (o .:? "id") - <*> (o .:? "username") - <*> (o .:? "firstName") - <*> (o .:? "lastName") - <*> (o .:? "email") - <*> (o .:? "password") - <*> (o .:? "phone") - <*> (o .:? "userStatus") + <$> (o .:? "id") + <*> (o .:? "username") + <*> (o .:? "firstName") + <*> (o .:? "lastName") + <*> (o .:? "email") + <*> (o .:? "password") + <*> (o .:? "phone") + <*> (o .:? "userStatus") instance A.ToJSON User where - toJSON User {..} = + toJSON User {..} = _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus ] @@ -323,55 +323,55 @@ -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) _omitNulls :: [(Text, A.Value)] -> A.Value -_omitNulls = A.object . P.filter notNull +_omitNulls = A.object . P.filter notNull where - notNull (_, A.Null) = False + notNull (_, A.Null) = False notNull _ = True -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing -_emptyToNothing x = x +_emptyToNothing x = x {-# INLINE _emptyToNothing #-} -_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a -_memptyToNothing (Just x) | x P.== P.mempty = Nothing -_memptyToNothing x = x +_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a +_memptyToNothing (Just x) | x P.== P.mempty = Nothing +_memptyToNothing x = x {-# INLINE _memptyToNothing #-} -- * DateTime Formatting -- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _readDateTime = _parseISO8601 {-# INLINE _readDateTime #-} -- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] {-# INLINE _parseISO8601 #-} -- * Date Formatting -- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t +_readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} -- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ -_showDate :: TI.FormatTime t => t -> String +_showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html index 2a5910ad33e..25b9e55eff2 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -8,11 +8,13 @@ , module SwaggerPetstore.Model , module SwaggerPetstore.MimeTypes , module SwaggerPetstore.Lens - ) where - -import SwaggerPetstore.API -import SwaggerPetstore.Client -import SwaggerPetstore.Model -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens - \ No newline at end of file + , module SwaggerPetstore.Logging + ) where + +import SwaggerPetstore.API +import SwaggerPetstore.Client +import SwaggerPetstore.Model +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens +import SwaggerPetstore.Logging + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index 50432703ab5..717d03643f0 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -13,19 +13,22 @@ import qualified SwaggerPetstore as S import Data.Monoid ((<>)) +import System.Environment (getEnvironment) + -- * MAIN main :: IO () main = do + env <- getEnvironment + 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 - } + config0 <- S.withStdoutLogging =<< S.newConfig + + let config = case lookup "HOST" env of + Just h -> config0 { S.configHost = BCL.pack h } + _ -> config0 putStrLn "******** CONFIG ********" putStrLn (show config) diff --git a/samples/client/petstore/haskell-http-client/example-app/debugLog.txt b/samples/client/petstore/haskell-http-client/example-app/debugLog.txt deleted file mode 100644 index 45de7fc52a1..00000000000 --- a/samples/client/petstore/haskell-http-client/example-app/debugLog.txt +++ /dev/null @@ -1,95 +0,0 @@ -******** 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= -[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= -[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= -[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 = "3catname30nameurl1url2available", 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= -[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= -[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= -[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= -[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= -[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= -[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= -[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= -[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= -[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 ******** diff --git a/samples/client/petstore/haskell-http-client/example-app/infoLog.txt b/samples/client/petstore/haskell-http-client/example-app/infoLog.txt index fa386df6764..a2da7f6e1c6 100644 --- a/samples/client/petstore/haskell-http-client/example-app/infoLog.txt +++ b/samples/client/petstore/haskell-http-client/example-app/infoLog.txt @@ -1,55 +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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/pet/11 +getPetById: found pet: Pet {petId = Just 11, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold +findPetsByStatus: found 10 pets +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ: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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:PUT 0.0.0.0/v2/pet +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (PUT 0.0.0.0/v2/pet) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet/11 +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet/11/uploadImage +uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 942 bytes"} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet/11/uploadImage) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:DELETE 0.0.0.0/v2/pet/11 ******** 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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ: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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/store/order +placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-12 03:59:19.571 UTC, orderStatus = Nothing, orderComplete = Just False} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/store/order) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ: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-12 03:59:19.571 UTC, orderStatus = Nothing, orderComplete = Just False} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ: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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user/createWithArray +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user/createWithList +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ: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) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername +loginUser: logged in user session:1505188759581 +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:PUT 0.0.0.0/v2/user/hsusername +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/user/logout +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/logout) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:DELETE 0.0.0.0/v2/user/hsusername ******** END ******** +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername) diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index edfeec4b1de..cb5e7c140c1 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -8,6 +8,7 @@ module SwaggerPetstore , module SwaggerPetstore.Model , module SwaggerPetstore.MimeTypes , module SwaggerPetstore.Lens + , module SwaggerPetstore.Logging ) where import SwaggerPetstore.API @@ -15,3 +16,4 @@ import SwaggerPetstore.Client import SwaggerPetstore.Model import SwaggerPetstore.MimeTypes import SwaggerPetstore.Lens +import SwaggerPetstore.Logging diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index 681ecb28607..ade235e502c 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -17,6 +17,7 @@ module SwaggerPetstore.Client where import SwaggerPetstore.Model import SwaggerPetstore.API import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Logging import qualified Control.Monad.IO.Class as P import qualified Data.Aeson as A @@ -30,8 +31,6 @@ import Web.FormUrlEncoded as WH import Web.HttpApiData as WH import Control.Monad.Catch (MonadThrow) -import qualified Control.Monad.Logger as LG - import qualified Data.Time as TI import qualified Data.Map as Map import qualified Data.Text as T @@ -57,8 +56,8 @@ import qualified Control.Exception.Safe as E data SwaggerPetstoreConfig = SwaggerPetstoreConfig { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger } -- | display the config @@ -79,29 +78,29 @@ instance Show SwaggerPetstoreConfig where -- -- @"swagger-haskell-http-client/1.0.0"@ -- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: SwaggerPetstoreConfig -newConfig = - SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * Dispatch @@ -146,10 +145,10 @@ dispatchMime dispatchMime manager config request accept = do httpResponse <- dispatchLbs manager config request accept parsedResult <- - runExceptionLoggingT "Client" config $ + runConfigLogWithExceptions "Client" config $ do case mimeUnrender' accept (NH.responseBody httpResponse) of Left s -> do - logNST LG.LevelError "Client" (T.pack s) + _log "Client" levelError (T.pack s) pure (Left (MimeError s httpResponse)) Right r -> pure (Right r) return (MimeResult parsedResult httpResponse) @@ -187,15 +186,15 @@ dispatchInitUnsafe -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) return res where - logSrc = "Client" + src = "Client" endpoint = T.pack $ BC.unpack $ @@ -250,68 +249,16 @@ modifyInitRequest (InitRequest req) f = InitRequest (f req) modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) --- * Logging - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - -- ** Logging --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT +-- | Run a block using the configured logger instance +runConfigLog + :: P.MonadIO m + => SwaggerPetstoreConfig -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) + +-- | Run a block using the configured logger instance (logs exceptions) +runConfigLogWithExceptions :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + => T.Text -> SwaggerPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs new file mode 100644 index 00000000000..7ab4bac9186 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs @@ -0,0 +1,108 @@ +{-| +Module : SwaggerPetstore.Logging +Katip Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module SwaggerPetstore.Logging where + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import qualified Katip as LG + +-- * Type Aliases (for compatability) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A Katip logging block +type LogExec m = forall a. LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "SwaggerPetstore" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs index d14764e85a8..694236456e2 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -52,9 +52,9 @@ import qualified Prelude as P -- -- Describes the result of uploading an image resource data ApiResponse = ApiResponse - { apiResponseCode :: Maybe Int -- ^ "code" - , apiResponseType :: Maybe Text -- ^ "type" - , apiResponseMessage :: Maybe Text -- ^ "message" + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON ApiResponse where @@ -91,8 +91,8 @@ mkApiResponse = -- -- A category for a pet data Category = Category - { categoryId :: Maybe Integer -- ^ "id" - , categoryName :: Maybe Text -- ^ "name" + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Category where @@ -126,12 +126,12 @@ mkCategory = -- -- An order for a pets from the pet store data Order = Order - { orderId :: Maybe Integer -- ^ "id" - , orderPetId :: Maybe Integer -- ^ "petId" - , orderQuantity :: Maybe Int -- ^ "quantity" - , orderShipDate :: Maybe UTCTime -- ^ "shipDate" - , orderStatus :: Maybe Text -- ^ "status" - Order Status - , orderComplete :: Maybe Bool -- ^ "complete" + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" + , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Order where @@ -177,12 +177,12 @@ mkOrder = -- -- A pet for sale in the pet store data Pet = Pet - { petId :: Maybe Integer -- ^ "id" - , petCategory :: Maybe Category -- ^ "category" - , petName :: Text -- ^ /Required/ "name" - , petPhotoUrls :: [Text] -- ^ /Required/ "photoUrls" - , petTags :: Maybe [Tag] -- ^ "tags" - , petStatus :: Maybe Text -- ^ "status" - pet status in the store + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Pet where @@ -230,8 +230,8 @@ mkPet petName petPhotoUrls = -- -- A tag for a pet data Tag = Tag - { tagId :: Maybe Integer -- ^ "id" - , tagName :: Maybe Text -- ^ "name" + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Tag where @@ -265,14 +265,14 @@ mkTag = -- -- A User who is purchasing from the pet store data User = User - { userId :: Maybe Integer -- ^ "id" - , userUsername :: Maybe Text -- ^ "username" - , userFirstName :: Maybe Text -- ^ "firstName" - , userLastName :: Maybe Text -- ^ "lastName" - , userEmail :: Maybe Text -- ^ "email" - , userPassword :: Maybe Text -- ^ "password" - , userPhone :: Maybe Text -- ^ "phone" - , userUserStatus :: Maybe Int -- ^ "userStatus" - User Status + { userId :: !(Maybe Integer) -- ^ "id" + , userUsername :: !(Maybe Text) -- ^ "username" + , userFirstName :: !(Maybe Text) -- ^ "firstName" + , userLastName :: !(Maybe Text) -- ^ "lastName" + , userEmail :: !(Maybe Text) -- ^ "email" + , userPassword :: !(Maybe Text) -- ^ "password" + , userPhone :: !(Maybe Text) -- ^ "phone" + , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON User where diff --git a/samples/client/petstore/haskell-http-client/package.yaml b/samples/client/petstore/haskell-http-client/package.yaml index 4ec0778ce1a..2c34aca81ba 100644 --- a/samples/client/petstore/haskell-http-client/package.yaml +++ b/samples/client/petstore/haskell-http-client/package.yaml @@ -37,7 +37,7 @@ ghc-options: -Wall library: source-dirs: lib ghc-options: - + - -funbox-strict-fields exposed-modules: - SwaggerPetstore - SwaggerPetstore.API @@ -45,6 +45,7 @@ library: - SwaggerPetstore.Model - SwaggerPetstore.MimeTypes - SwaggerPetstore.Lens + - SwaggerPetstore.Logging dependencies: - aeson >=1.0 && <2.0 - bytestring >=0.10.0 && <0.11 @@ -61,7 +62,7 @@ library: - network >=2.6.2 && <2.7 - random >=1.1 - exceptions >= 0.4 - - monad-logger >=0.3 && <0.4 + - katip >=0.4 && < 0.6 - safe-exceptions <0.2 - case-insensitive - microlens >= 0.4.3 && <0.5 diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index e8e4b538161..0a9491bc7b9 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -7,7 +7,6 @@ version: 0.1.0.0 synopsis: Auto-generated swagger-petstore API Client description: . Client library for calling the swagger-petstore API based on http-client. - host: petstore.swagger.io . base path: http://petstore.swagger.io/v2 . @@ -15,7 +14,7 @@ description: . . swagger version: 2.0 . - OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md + OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md category: Web homepage: https://github.com/swagger-api/swagger-codegen#readme author: Author Name Here @@ -32,7 +31,7 @@ extra-source-files: library hs-source-dirs: lib - ghc-options: -Wall + ghc-options: -Wall -funbox-strict-fields build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 @@ -53,7 +52,7 @@ library , network >=2.6.2 && <2.7 , random >=1.1 , exceptions >= 0.4 - , monad-logger >=0.3 && <0.4 + , katip >=0.4 && < 0.6 , safe-exceptions <0.2 , case-insensitive , microlens >= 0.4.3 && <0.5 @@ -64,6 +63,7 @@ library SwaggerPetstore.Model SwaggerPetstore.MimeTypes SwaggerPetstore.Lens + SwaggerPetstore.Logging other-modules: Paths_swagger_petstore default-language: Haskell2010 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml index 44bc8174414..211e8abb300 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -29,7 +29,6 @@ dependencies: - text >=0.11 && <1.3 - time >=1.5 && <1.9 - vector >=0.10.9 && <0.13 -- monad-logger >=0.3 && <0.4 - exceptions >= 0.4 - case-insensitive - safe-exceptions <0.2 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal index 98c3670066a..4da1e31bab9 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal @@ -40,7 +40,6 @@ test-suite tests , text >=0.11 && <1.3 , time >=1.5 && <1.9 , vector >=0.10.9 && <0.13 - , monad-logger >=0.3 && <0.4 , exceptions >= 0.4 , case-insensitive , safe-exceptions <0.2 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index b1fe57c0793..36663eb5fd3 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -53,10 +53,8 @@ main = do Just h -> BCL.pack h _ -> "http://0.0.0.0/v2" - let config = - S.withStdoutLogging - S.newConfig { S.configHost = host } - -- , S.configLoggingFilter = S.debugLevelFilter } + config0 <- S.withStdoutLogging =<< S.newConfig + let config = config0 { S.configHost = host } putStrLn "\n******** CONFIG ********" putStrLn (show config)