From 4310ea326c182e03ff66fdae5bed09e05132c0c5 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Thu, 7 Sep 2017 10:17:49 -0500 Subject: [PATCH] [haskell-http-client] update readme; improve lens generation; fix dateFormat (#6448) * point readme links to canonical locations * use lenses for non-required model fields, instead of traversals * fix .gitignore generation * fix dateFormat cli option bug --- .../languages/HaskellHttpClientCodegen.java | 4 +- .../haskell-http-client/Lens.mustache | 21 +- .../haskell-http-client/README.mustache | 35 +- .../{.gitignore => gitignore.mustache} | 0 .../petstore/haskell-http-client/README.md | 21 +- .../petstore/haskell-http-client/docs.sh | 31 -- .../docs/SwaggerPetstore-Lens.html | 2 +- .../docs/SwaggerPetstore-Model.html | 2 +- .../docs/doc-index-95.html | 2 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.html | 2 +- .../haskell-http-client/docs/doc-index-C.html | 2 +- .../haskell-http-client/docs/doc-index-O.html | 2 +- .../haskell-http-client/docs/doc-index-P.html | 2 +- .../haskell-http-client/docs/doc-index-T.html | 2 +- .../haskell-http-client/docs/doc-index-U.html | 2 +- .../docs/mini_SwaggerPetstore-Lens.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 8 +- .../docs/src/SwaggerPetstore.API.html | 336 +++++++++--------- .../docs/src/SwaggerPetstore.Client.html | 212 +++++------ .../docs/src/SwaggerPetstore.Lens.html | 313 ++++++++-------- .../docs/src/SwaggerPetstore.Model.html | 8 +- .../haskell-http-client/example-app/Main.hs | 4 +- .../lib/SwaggerPetstore/Lens.hs | 213 ++++++----- .../lib/SwaggerPetstore/Model.hs | 8 +- .../swagger-petstore.cabal | 3 +- .../tests-integration/package.yaml | 5 +- .../swagger-petstore-tests-integration.cabal | 5 +- .../tests-integration/tests/Test.hs | 6 +- 29 files changed, 601 insertions(+), 654 deletions(-) rename modules/swagger-codegen/src/main/resources/haskell-http-client/{.gitignore => gitignore.mustache} (100%) delete mode 100755 samples/client/petstore/haskell-http-client/docs.sh 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 cd60a221aec..5f57e100c50 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 @@ -128,7 +128,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("stack.mustache", "", "stack.yaml")); supportingFiles.add(new SupportingFile("Setup.mustache", "", "Setup.hs")); - supportingFiles.add(new SupportingFile(".gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); @@ -241,7 +241,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC public void setDateFormat(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.remove(DATE_FORMAT); + additionalProperties.put(DATE_FORMAT, defaultDateFormat); } else { additionalProperties.put(DATE_FORMAT, value); } diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache index 4df5c4a8cdd..3ac0727fe49 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache @@ -29,8 +29,6 @@ import {{title}}.Model -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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 @@ -40,27 +38,12 @@ type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t -- * {{classname}} {{#vars}} -{{#required}} -- | '{{name}}' Lens -{{name}}L :: Lens_' {{classname}} {{datatype}} +{{name}}L :: Lens_' {{classname}} ({{^required}}Maybe {{/required}}{{datatype}}) {{name}}L f {{classname}}{..} = (\{{name}} -> {{classname}} { {{name}}, ..} ) <$> f {{name}} {-# INLINE {{name}}L #-} -{{/required}} -{{^required}} --- | '{{name}}' Traversal -{{name}}T :: Traversal_' {{classname}} {{datatype}} -{{name}}T f s = _mtraversal {{name}} (\b -> s { {{name}} = Just b}) f s -{-# INLINE {{name}}T #-} -{{/required}} {{/vars}} {{/model}} -{{/models}} - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} +{{/models}} \ No newline at end of file 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 39c9c6d457d..4a32daa917c 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 @@ -62,16 +62,16 @@ These options allow some customization of the code generation process. **haskell-http-client specific options:** -| OPTION | DESCRIPTION | DEFAULT | ACTUAL | -| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------- | -| allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | {{allowFromJsonNulls}} | -| allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | {{allowToJsonNulls}} | -| dateFormat | format string used to parse/render a date | %Y-%m-%d | {{dateFormat}} | -| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | {{dateTimeFormat}} | -| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | {{generateFormUrlEncodedInstances}} | -| 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}} | +| OPTION | DESCRIPTION | DEFAULT | ACTUAL | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | +| allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | {{{allowFromJsonNulls}}} | +| allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | {{{allowToJsonNulls}}} | +| dateFormat | format string used to parse/render a date | %Y-%m-%d | {{{dateFormat}}} | +| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | {{{dateTimeFormat}}} | +| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | {{{generateFormUrlEncodedInstances}}} | +| 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}}} | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -85,13 +85,13 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] -[2]: https://jonschoning.github.io/swaggerpetstore-haskell-http-client/ +[2]: https://hackage.haskell.org/package/swagger-petstore ### Example SwaggerPetstore App An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/jonschoning/swagger-codegen/tree/haskell-http-client/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app ### Usage Notes @@ -103,22 +103,23 @@ This library is intended to be imported qualified. | {{title}}.API | construct requetss | | {{title}}.Model | describes models | | {{title}}.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| {{title}}.Lens | lenses & traversals for model fields | +| {{title}}.Lens | lenses for model fields | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). For example, if there is an Operation named _addFoo_, there will be a -data type generated named _AddFoo_ (note the capitalization) which -describes additional constraints and actions on the _addFoo_ -operation, which can be viewed in GHCi or via the Haddocks. +data type generated named _AddFoo_ (note the capitalization), which +describes additional constraints and actions on the _addFoo_ operation +via its typeclass instances. These typeclass instances can be viewed +in GHCi or via the Haddocks. * requried parameters are included as function arguments to _addFoo_ * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell data AddFoo diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/.gitignore b/modules/swagger-codegen/src/main/resources/haskell-http-client/gitignore.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/haskell-http-client/.gitignore rename to modules/swagger-codegen/src/main/resources/haskell-http-client/gitignore.mustache diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index d1ee4f9c200..817c834271d 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -62,11 +62,11 @@ These options allow some customization of the code generation process. **haskell-http-client specific options:** -| OPTION | DESCRIPTION | DEFAULT | ACTUAL | -| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------- | +| OPTION | DESCRIPTION | DEFAULT | ACTUAL | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | | allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | true | | allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | false | -| dateFormat | format string used to parse/render a date | %Y-%m-%d | | +| dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d | | dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | | | generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true | | generateLenses | Generate Lens optics for Models | true | true | @@ -85,13 +85,13 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] -[2]: https://jonschoning.github.io/swaggerpetstore-haskell-http-client/ +[2]: https://hackage.haskell.org/package/swagger-petstore ### Example SwaggerPetstore App An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/jonschoning/swagger-codegen/tree/haskell-http-client/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app ### Usage Notes @@ -103,22 +103,23 @@ This library is intended to be imported qualified. | SwaggerPetstore.API | construct requetss | | SwaggerPetstore.Model | describes models | | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| SwaggerPetstore.Lens | lenses & traversals for model fields | +| SwaggerPetstore.Lens | lenses for model fields | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). For example, if there is an Operation named _addFoo_, there will be a -data type generated named _AddFoo_ (note the capitalization) which -describes additional constraints and actions on the _addFoo_ -operation, which can be viewed in GHCi or via the Haddocks. +data type generated named _AddFoo_ (note the capitalization), which +describes additional constraints and actions on the _addFoo_ operation +via its typeclass instances. These typeclass instances can be viewed +in GHCi or via the Haddocks. * requried parameters are included as function arguments to _addFoo_ * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell data AddFoo diff --git a/samples/client/petstore/haskell-http-client/docs.sh b/samples/client/petstore/haskell-http-client/docs.sh deleted file mode 100755 index 5db07846482..00000000000 --- a/samples/client/petstore/haskell-http-client/docs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e - -cabal_file=$(find . -maxdepth 1 -name "*.cabal" -print -quit) - -if [ ! -f "$cabal_file" ]; then - echo "Run this script in the top-level package directory" - exit 1 -fi - -pkg=$(awk -F ":[[:space:]]*" 'tolower($1)=="name" { print $2 }' < "$cabal_file") -ver=$(awk -F ":[[:space:]]*" 'tolower($1)=="version" { print $2 }' < "$cabal_file") - -if [ -z "$pkg" ]; then - echo "Unable to determine package name" - exit 1 -fi - -if [ -z "$ver" ]; then - echo "Unable to determine package version" - exit 1 -fi - -echo "Detected package: $pkg-$ver" - -cabal haddock --hyperlink-source --html-location='https://www.stackage.org/haddock/nightly-2017-08-25/$pkg-$version' --contents-location='https://www.stackage.org/nightly-2017-08-25/package/$pkg-$version' - -dir="build-docs" -trap 'rm -r "$dir"' EXIT -mkdir -p $dir -cp -R dist/doc/html/$pkg/ $dir/$pkg-$ver-docs diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html index 483f5a824b7..ccc05213f5d 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html @@ -1,4 +1,4 @@ SwaggerPetstore.Lens

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

Type Aliases

type Traversal_' s a = Traversal_ s s a a Source #

type Traversal_ s t a b = forall f. Applicative f => (a -> f b) -> s -> f t Source #

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall f. Functor f => (a -> f b) -> s -> f t Source #

ApiResponse

Category

Order

Pet

Tag

User

Helpers

_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b Source #

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall f. Functor f => (a -> f b) -> s -> f t Source #

ApiResponse

Category

Order

Pet

Tag

User

\ 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 2a177e5595d..dc94e0e3b1d 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 ""

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

TI.formatTime TI.defaultTimeLocale ""
\ No newline at end of file +

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 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 33974e19019..f05689deb6e 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
_mtraversalSwaggerPetstore.Lens, 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
_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 8787e590900..b27a47d654f 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
apiResponseCodeTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeTSwaggerPetstore.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 cce57dec8d6..a0148f93dd7 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
apiResponseCodeTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeTSwaggerPetstore.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
categoryIdTSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameTSwaggerPetstore.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
orderCompleteTSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdTSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdTSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityTSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateTSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusTSwaggerPetstore.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
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryTSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdTSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusTSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsTSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, 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
tagIdTSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameTSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
Traversal_SwaggerPetstore.Lens, SwaggerPetstore
Traversal_'SwaggerPetstore.Lens, 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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailTSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameTSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdTSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameTSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordTSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneTSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameTSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusTSwaggerPetstore.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
_mtraversalSwaggerPetstore.Lens, 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
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
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.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
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, 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
urlPathSwaggerPetstore.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 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 e9a866aaaba..863fdeaafeb 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
categoryIdTSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameTSwaggerPetstore.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
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 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 3376ab88ac7..cef8bb7a96d 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
orderCompleteTSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdTSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdTSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityTSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateTSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusTSwaggerPetstore.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 5b53cdf63d2..39fc9910d83 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
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryTSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdTSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusTSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsTSwaggerPetstore.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
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.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-T.html b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html index 87f05f58042..a918a451f03 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
tagIdTSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameTSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
Traversal_SwaggerPetstore.Lens, SwaggerPetstore
Traversal_'SwaggerPetstore.Lens, 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 0bb882935f4..916d307b244 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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailTSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameTSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdTSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameTSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordTSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneTSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameTSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusTSwaggerPetstore.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
urlPathSwaggerPetstore.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/mini_SwaggerPetstore-Lens.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html index 32e4b2770c4..930ee673c3e 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html @@ -1,4 +1,4 @@ SwaggerPetstore.Lens

SwaggerPetstore.Lens

Type Aliases

type Traversal_' s a

type Traversal_ s t a b

type Lens_' s a

type Lens_ s t a b

ApiResponse

Category

Order

Pet

Tag

User

Helpers

\ No newline at end of file +

SwaggerPetstore.Lens

Type Aliases

type Lens_' s a

type Lens_ s t a b

ApiResponse

Category

Order

Pet

Tag

User

\ 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 3cd3b9c5cca..d6c2472e097 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 @@ -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 e7113e60a2f..bd48b3f7366 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 @@ -79,13 +79,13 @@ Module : SwaggerPetstore.API -- 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 @@ -117,15 +117,15 @@ Module : SwaggerPetstore.API -- 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@ @@ -145,9 +145,9 @@ Module : SwaggerPetstore.API 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@ @@ -169,9 +169,9 @@ Module : SwaggerPetstore.API 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 "" #-} @@ -195,8 +195,8 @@ Module : SwaggerPetstore.API 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 @@ -219,13 +219,13 @@ Module : SwaggerPetstore.API -- 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 @@ -256,25 +256,25 @@ Module : SwaggerPetstore.API -- 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 @@ -296,25 +296,25 @@ Module : SwaggerPetstore.API -- 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 @@ -337,9 +337,9 @@ Module : SwaggerPetstore.API -- 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 @@ -380,8 +380,8 @@ Module : SwaggerPetstore.API 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 @@ -400,13 +400,13 @@ Module : SwaggerPetstore.API -- -- 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 @@ -431,13 +431,13 @@ Module : SwaggerPetstore.API -- 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 @@ -460,13 +460,13 @@ Module : SwaggerPetstore.API -- 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 @@ -489,13 +489,13 @@ Module : SwaggerPetstore.API -- 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 @@ -519,9 +519,9 @@ Module : SwaggerPetstore.API -- 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 @@ -542,8 +542,8 @@ Module : SwaggerPetstore.API 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 @@ -565,10 +565,10 @@ Module : SwaggerPetstore.API :: 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@ @@ -588,7 +588,7 @@ Module : SwaggerPetstore.API -- Note: Has 'Produces' instances, but no response schema -- logoutUser - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res logoutUser = _mkRequest "GET" ["/user/logout"] @@ -610,15 +610,15 @@ Module : SwaggerPetstore.API -- 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 @@ -634,25 +634,25 @@ Module : SwaggerPetstore.API -- * 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 -&- @@ -674,7 +674,7 @@ Module : SwaggerPetstore.API -- * 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 , urlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , params :: Params -- ^ params of SwaggerPetstoreRequest @@ -702,85 +702,85 @@ Module : SwaggerPetstore.API _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 = - let _params = params (req `removeHeader` P.fmap P.fst header) - in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + let _params = params (req `removeHeader` P.fmap P.fst header) + in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - let _params = params req - in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } - where cifst = CI.mk . P.fst +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + let _params = params req + in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } + where 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 = - let _params = params req - in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } - where cifst = CI.mk . P.fst +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_setQuery req query = + let _params = params req + in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } + where cifst = CI.mk . P.fst -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let _params = params req - form = case paramsBody _params of - ParamBodyFormUrlEncoded _form -> _form +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_addForm req newform = + let _params = params req + form = case paramsBody _params of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } + in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let _params = params req - parts = case paramsBody _params of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let _params = params req + parts = case paramsBody _params of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } + in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyB body } } +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + let _params = params req + in req { params = _params { paramsBody = ParamBodyB body } } -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyBL body } } +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + let _params = params req + in req { params = _params { paramsBody = 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 @@ -792,38 +792,38 @@ Module : SwaggerPetstore.API | 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 22411c07f3b..27f9b2475b0 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 @@ -63,11 +63,11 @@ Module : SwaggerPetstore.Client -- | display the config instance Show SwaggerPetstoreConfig where - show c = + show c = T.printf "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) + (show (configHost c)) + (show (configUserAgent c)) -- | constructs a default SwaggerPetstoreConfig -- @@ -93,15 +93,15 @@ Module : SwaggerPetstore.Client -- | updates the config to use a MonadLogger instance which prints to stdout. withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} +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} +withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} -- | updates the config to disable logging withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configExecLoggingT = runNullLoggingT} -- * Dispatch @@ -109,21 +109,21 @@ Module : SwaggerPetstore.Client -- | send a request returning the raw http response dispatchLbs - :: (Produces req accept, MimeType contentType) + :: (Produces req accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> 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 +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 +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -137,124 +137,124 @@ Module : SwaggerPetstore.Client -- | send a request returning the 'MimeResult' dispatchMime - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: (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) + -> 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) + :: (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 + -> 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) + :: (MimeType accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> 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 +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 + -> 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 +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 = + 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) + 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 <> ")" + 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 +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) + :: (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 (urlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) - reqQuery = NH.renderQuery True (paramsQuery (params req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + -> 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 (urlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) + reqQuery = NH.renderQuery True (paramsQuery (params req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (params 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 + outReq <- case paramsBody (params 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) + 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) +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) +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 +type ExecLoggingT = forall m. P.MonadIO m => + forall a. LG.LoggingT m a -> m a -- ** Null Logger @@ -263,7 +263,7 @@ Module : SwaggerPetstore.Client nullLogger _ _ _ _ = return () -- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a +runNullLoggingT :: LG.LoggingT m a -> m a runNullLoggingT = (`LG.runLoggingT` nullLogger) -- ** Logging Filters @@ -281,38 +281,38 @@ Module : SwaggerPetstore.Client debugLevelFilter = minLevelFilter LG.LevelDebug minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l +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) +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 = + 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 = + :: (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) + (\(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) +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 + :: (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 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 80eecd30a60..83e9ff79157 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,175 +29,166 @@ Module : SwaggerPetstore.Lens -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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 - +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 --- * ApiResponse - --- | 'apiResponseCode' Traversal -apiResponseCodeT :: Traversal_' ApiResponse Int -apiResponseCodeT f s = _mtraversal apiResponseCode (\b -> s { apiResponseCode = Just b}) f s -{-# INLINE apiResponseCodeT #-} - --- | 'apiResponseType' Traversal -apiResponseTypeT :: Traversal_' ApiResponse Text -apiResponseTypeT f s = _mtraversal apiResponseType (\b -> s { apiResponseType = Just b}) f s -{-# INLINE apiResponseTypeT #-} - --- | 'apiResponseMessage' Traversal -apiResponseMessageT :: Traversal_' ApiResponse Text -apiResponseMessageT f s = _mtraversal apiResponseMessage (\b -> s { apiResponseMessage = Just b}) f s -{-# INLINE apiResponseMessageT #-} +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +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 +{-# INLINE apiResponseTypeL #-} + +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} + + - +-- * Category --- * Category - --- | 'categoryId' Traversal -categoryIdT :: Traversal_' Category Integer -categoryIdT f s = _mtraversal categoryId (\b -> s { categoryId = Just b}) f s -{-# INLINE categoryIdT #-} - --- | 'categoryName' Traversal -categoryNameT :: Traversal_' Category Text -categoryNameT f s = _mtraversal categoryName (\b -> s { categoryName = Just b}) f s -{-# INLINE categoryNameT #-} +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +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 +{-# INLINE categoryNameL #-} + + - +-- * Order --- * Order - --- | 'orderId' Traversal -orderIdT :: Traversal_' Order Integer -orderIdT f s = _mtraversal orderId (\b -> s { orderId = Just b}) f s -{-# INLINE orderIdT #-} - --- | 'orderPetId' Traversal -orderPetIdT :: Traversal_' Order Integer -orderPetIdT f s = _mtraversal orderPetId (\b -> s { orderPetId = Just b}) f s -{-# INLINE orderPetIdT #-} - --- | 'orderQuantity' Traversal -orderQuantityT :: Traversal_' Order Int -orderQuantityT f s = _mtraversal orderQuantity (\b -> s { orderQuantity = Just b}) f s -{-# INLINE orderQuantityT #-} - --- | 'orderShipDate' Traversal -orderShipDateT :: Traversal_' Order UTCTime -orderShipDateT f s = _mtraversal orderShipDate (\b -> s { orderShipDate = Just b}) f s -{-# INLINE orderShipDateT #-} - --- | 'orderStatus' Traversal -orderStatusT :: Traversal_' Order Text -orderStatusT f s = _mtraversal orderStatus (\b -> s { orderStatus = Just b}) f s -{-# INLINE orderStatusT #-} - --- | 'orderComplete' Traversal -orderCompleteT :: Traversal_' Order Bool -orderCompleteT f s = _mtraversal orderComplete (\b -> s { orderComplete = Just b}) f s -{-# INLINE orderCompleteT #-} +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +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 +{-# INLINE orderPetIdL #-} + +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +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 +{-# INLINE orderShipDateL #-} + +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +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 +{-# INLINE orderCompleteL #-} + + - +-- * Pet --- * Pet - --- | 'petId' Traversal -petIdT :: Traversal_' Pet Integer -petIdT f s = _mtraversal petId (\b -> s { petId = Just b}) f s -{-# INLINE petIdT #-} - --- | 'petCategory' Traversal -petCategoryT :: Traversal_' Pet Category -petCategoryT f s = _mtraversal petCategory (\b -> s { petCategory = Just b}) f s -{-# INLINE petCategoryT #-} - --- | 'petName' Lens -petNameL :: Lens_' Pet Text -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName -{-# INLINE petNameL #-} - --- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet [Text] -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls -{-# INLINE petPhotoUrlsL #-} - --- | 'petTags' Traversal -petTagsT :: Traversal_' Pet [Tag] -petTagsT f s = _mtraversal petTags (\b -> s { petTags = Just b}) f s -{-# INLINE petTagsT #-} - --- | 'petStatus' Traversal -petStatusT :: Traversal_' Pet Text -petStatusT f s = _mtraversal petStatus (\b -> s { petStatus = Just b}) f s -{-# INLINE petStatusT #-} +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +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 +{-# INLINE petCategoryL #-} + +-- | 'petName' Lens +petNameL :: Lens_' Pet (Text) +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +{-# INLINE petNameL #-} + +-- | 'petPhotoUrls' Lens +petPhotoUrlsL :: Lens_' Pet ([Text]) +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 +{-# INLINE petTagsL #-} + +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} + + - +-- * Tag --- * Tag - --- | 'tagId' Traversal -tagIdT :: Traversal_' Tag Integer -tagIdT f s = _mtraversal tagId (\b -> s { tagId = Just b}) f s -{-# INLINE tagIdT #-} - --- | 'tagName' Traversal -tagNameT :: Traversal_' Tag Text -tagNameT f s = _mtraversal tagName (\b -> s { tagName = Just b}) f s -{-# INLINE tagNameT #-} +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +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 +{-# INLINE tagNameL #-} + + - +-- * User --- * User - --- | 'userId' Traversal -userIdT :: Traversal_' User Integer -userIdT f s = _mtraversal userId (\b -> s { userId = Just b}) f s -{-# INLINE userIdT #-} - --- | 'userUsername' Traversal -userUsernameT :: Traversal_' User Text -userUsernameT f s = _mtraversal userUsername (\b -> s { userUsername = Just b}) f s -{-# INLINE userUsernameT #-} - --- | 'userFirstName' Traversal -userFirstNameT :: Traversal_' User Text -userFirstNameT f s = _mtraversal userFirstName (\b -> s { userFirstName = Just b}) f s -{-# INLINE userFirstNameT #-} - --- | 'userLastName' Traversal -userLastNameT :: Traversal_' User Text -userLastNameT f s = _mtraversal userLastName (\b -> s { userLastName = Just b}) f s -{-# INLINE userLastNameT #-} - --- | 'userEmail' Traversal -userEmailT :: Traversal_' User Text -userEmailT f s = _mtraversal userEmail (\b -> s { userEmail = Just b}) f s -{-# INLINE userEmailT #-} - --- | 'userPassword' Traversal -userPasswordT :: Traversal_' User Text -userPasswordT f s = _mtraversal userPassword (\b -> s { userPassword = Just b}) f s -{-# INLINE userPasswordT #-} - --- | 'userPhone' Traversal -userPhoneT :: Traversal_' User Text -userPhoneT f s = _mtraversal userPhone (\b -> s { userPhone = Just b}) f s -{-# INLINE userPhoneT #-} - --- | 'userUserStatus' Traversal -userUserStatusT :: Traversal_' User Int -userUserStatusT f s = _mtraversal userUserStatus (\b -> s { userUserStatus = Just b}) f s -{-# INLINE userUserStatusT #-} - - - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} - \ No newline at end of file +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +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 +{-# INLINE userUsernameL #-} + +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +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 +{-# INLINE userLastNameL #-} + +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +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 +{-# INLINE userPasswordL #-} + +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +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 +{-# INLINE userUserStatusL #-} + + + \ 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 3d644d6fe5c..1dd3fd817c3 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 @@ -365,14 +365,14 @@ Module : SwaggerPetstore.Model -- * Date Formatting --- | @TI.parseTimeM True TI.defaultTimeLocale ""@ +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = - TI.parseTimeM True TI.defaultTimeLocale "" + TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} --- | @TI.formatTime TI.defaultTimeLocale ""@ +-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ _showDate :: TI.FormatTime t => t -> String _showDate = - TI.formatTime TI.defaultTimeLocale "" + TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} \ 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 ff9900c31ce..50432703ab5 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -200,8 +200,8 @@ runUser mgr config = do let createUserRequest = S.createUser S.MimeJSON user _ <- S.dispatchLbs mgr config createUserRequest S.MimeJSON - -- can use traversals or lenses (model record names are appended with T or L) to view or modify records - let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameT (<> "*") . L.over S.userIdT (+1)) user + -- can use lenses (model record names are appended L) to view or modify records + let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameL (fmap (<> "*")) . L.over S.userIdL (fmap (+ 1))) user let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON users _ <- S.dispatchLbs mgr config createUsersWithArrayInputRequest S.MimeNoContent diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs index 19c6ea3415a..db36f380fbe 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs @@ -29,174 +29,165 @@ import SwaggerPetstore.Model -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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' Traversal -apiResponseCodeT :: Traversal_' ApiResponse Int -apiResponseCodeT f s = _mtraversal apiResponseCode (\b -> s { apiResponseCode = Just b}) f s -{-# INLINE apiResponseCodeT #-} +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +{-# INLINE apiResponseCodeL #-} --- | 'apiResponseType' Traversal -apiResponseTypeT :: Traversal_' ApiResponse Text -apiResponseTypeT f s = _mtraversal apiResponseType (\b -> s { apiResponseType = Just b}) f s -{-# INLINE apiResponseTypeT #-} +-- | 'apiResponseType' Lens +apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +{-# INLINE apiResponseTypeL #-} --- | 'apiResponseMessage' Traversal -apiResponseMessageT :: Traversal_' ApiResponse Text -apiResponseMessageT f s = _mtraversal apiResponseMessage (\b -> s { apiResponseMessage = Just b}) f s -{-# INLINE apiResponseMessageT #-} +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} -- * Category --- | 'categoryId' Traversal -categoryIdT :: Traversal_' Category Integer -categoryIdT f s = _mtraversal categoryId (\b -> s { categoryId = Just b}) f s -{-# INLINE categoryIdT #-} +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +{-# INLINE categoryIdL #-} --- | 'categoryName' Traversal -categoryNameT :: Traversal_' Category Text -categoryNameT f s = _mtraversal categoryName (\b -> s { categoryName = Just b}) f s -{-# INLINE categoryNameT #-} +-- | 'categoryName' Lens +categoryNameL :: Lens_' Category (Maybe Text) +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +{-# INLINE categoryNameL #-} -- * Order --- | 'orderId' Traversal -orderIdT :: Traversal_' Order Integer -orderIdT f s = _mtraversal orderId (\b -> s { orderId = Just b}) f s -{-# INLINE orderIdT #-} +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +{-# INLINE orderIdL #-} --- | 'orderPetId' Traversal -orderPetIdT :: Traversal_' Order Integer -orderPetIdT f s = _mtraversal orderPetId (\b -> s { orderPetId = Just b}) f s -{-# INLINE orderPetIdT #-} +-- | 'orderPetId' Lens +orderPetIdL :: Lens_' Order (Maybe Integer) +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +{-# INLINE orderPetIdL #-} --- | 'orderQuantity' Traversal -orderQuantityT :: Traversal_' Order Int -orderQuantityT f s = _mtraversal orderQuantity (\b -> s { orderQuantity = Just b}) f s -{-# INLINE orderQuantityT #-} +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +{-# INLINE orderQuantityL #-} --- | 'orderShipDate' Traversal -orderShipDateT :: Traversal_' Order UTCTime -orderShipDateT f s = _mtraversal orderShipDate (\b -> s { orderShipDate = Just b}) f s -{-# INLINE orderShipDateT #-} +-- | 'orderShipDate' Lens +orderShipDateL :: Lens_' Order (Maybe UTCTime) +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +{-# INLINE orderShipDateL #-} --- | 'orderStatus' Traversal -orderStatusT :: Traversal_' Order Text -orderStatusT f s = _mtraversal orderStatus (\b -> s { orderStatus = Just b}) f s -{-# INLINE orderStatusT #-} +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +{-# INLINE orderStatusL #-} --- | 'orderComplete' Traversal -orderCompleteT :: Traversal_' Order Bool -orderCompleteT f s = _mtraversal orderComplete (\b -> s { orderComplete = Just b}) f s -{-# INLINE orderCompleteT #-} +-- | 'orderComplete' Lens +orderCompleteL :: Lens_' Order (Maybe Bool) +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +{-# INLINE orderCompleteL #-} -- * Pet --- | 'petId' Traversal -petIdT :: Traversal_' Pet Integer -petIdT f s = _mtraversal petId (\b -> s { petId = Just b}) f s -{-# INLINE petIdT #-} +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +{-# INLINE petIdL #-} --- | 'petCategory' Traversal -petCategoryT :: Traversal_' Pet Category -petCategoryT f s = _mtraversal petCategory (\b -> s { petCategory = Just b}) f s -{-# INLINE petCategoryT #-} +-- | 'petCategory' Lens +petCategoryL :: Lens_' Pet (Maybe Category) +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +{-# INLINE petCategoryL #-} -- | 'petName' Lens -petNameL :: Lens_' Pet Text +petNameL :: Lens_' Pet (Text) petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName {-# INLINE petNameL #-} -- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet [Text] +petPhotoUrlsL :: Lens_' Pet ([Text]) petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls {-# INLINE petPhotoUrlsL #-} --- | 'petTags' Traversal -petTagsT :: Traversal_' Pet [Tag] -petTagsT f s = _mtraversal petTags (\b -> s { petTags = Just b}) f s -{-# INLINE petTagsT #-} +-- | 'petTags' Lens +petTagsL :: Lens_' Pet (Maybe [Tag]) +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +{-# INLINE petTagsL #-} --- | 'petStatus' Traversal -petStatusT :: Traversal_' Pet Text -petStatusT f s = _mtraversal petStatus (\b -> s { petStatus = Just b}) f s -{-# INLINE petStatusT #-} +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} -- * Tag --- | 'tagId' Traversal -tagIdT :: Traversal_' Tag Integer -tagIdT f s = _mtraversal tagId (\b -> s { tagId = Just b}) f s -{-# INLINE tagIdT #-} +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +{-# INLINE tagIdL #-} --- | 'tagName' Traversal -tagNameT :: Traversal_' Tag Text -tagNameT f s = _mtraversal tagName (\b -> s { tagName = Just b}) f s -{-# INLINE tagNameT #-} +-- | 'tagName' Lens +tagNameL :: Lens_' Tag (Maybe Text) +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +{-# INLINE tagNameL #-} -- * User --- | 'userId' Traversal -userIdT :: Traversal_' User Integer -userIdT f s = _mtraversal userId (\b -> s { userId = Just b}) f s -{-# INLINE userIdT #-} +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +{-# INLINE userIdL #-} --- | 'userUsername' Traversal -userUsernameT :: Traversal_' User Text -userUsernameT f s = _mtraversal userUsername (\b -> s { userUsername = Just b}) f s -{-# INLINE userUsernameT #-} +-- | 'userUsername' Lens +userUsernameL :: Lens_' User (Maybe Text) +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +{-# INLINE userUsernameL #-} --- | 'userFirstName' Traversal -userFirstNameT :: Traversal_' User Text -userFirstNameT f s = _mtraversal userFirstName (\b -> s { userFirstName = Just b}) f s -{-# INLINE userFirstNameT #-} +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +{-# INLINE userFirstNameL #-} --- | 'userLastName' Traversal -userLastNameT :: Traversal_' User Text -userLastNameT f s = _mtraversal userLastName (\b -> s { userLastName = Just b}) f s -{-# INLINE userLastNameT #-} +-- | 'userLastName' Lens +userLastNameL :: Lens_' User (Maybe Text) +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +{-# INLINE userLastNameL #-} --- | 'userEmail' Traversal -userEmailT :: Traversal_' User Text -userEmailT f s = _mtraversal userEmail (\b -> s { userEmail = Just b}) f s -{-# INLINE userEmailT #-} +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +{-# INLINE userEmailL #-} --- | 'userPassword' Traversal -userPasswordT :: Traversal_' User Text -userPasswordT f s = _mtraversal userPassword (\b -> s { userPassword = Just b}) f s -{-# INLINE userPasswordT #-} +-- | 'userPassword' Lens +userPasswordL :: Lens_' User (Maybe Text) +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +{-# INLINE userPasswordL #-} --- | 'userPhone' Traversal -userPhoneT :: Traversal_' User Text -userPhoneT f s = _mtraversal userPhone (\b -> s { userPhone = Just b}) f s -{-# INLINE userPhoneT #-} +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +{-# INLINE userPhoneL #-} --- | 'userUserStatus' Traversal -userUserStatusT :: Traversal_' User Int -userUserStatusT f s = _mtraversal userUserStatus (\b -> s { userUserStatus = Just b}) f s -{-# INLINE userUserStatusT #-} +-- | 'userUserStatus' Lens +userUserStatusL :: Lens_' User (Maybe Int) +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +{-# INLINE userUserStatusL #-} - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} 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 a9faf092395..b2df5ab575c 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -365,14 +365,14 @@ _parseISO8601 t = -- * Date Formatting --- | @TI.parseTimeM True TI.defaultTimeLocale ""@ +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = - TI.parseTimeM True TI.defaultTimeLocale "" + TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} --- | @TI.formatTime TI.defaultTimeLocale ""@ +-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ _showDate :: TI.FormatTime t => t -> String _showDate = - TI.formatTime TI.defaultTimeLocale "" + TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index fd7d16c7f93..3d96cf923d8 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -7,6 +7,7 @@ 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 . @@ -14,7 +15,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 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 2fb6db94d74..dec56e307b3 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -29,9 +29,12 @@ 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 -- swagger-petstore +- safe-exceptions <0.2 - microlens +- swagger-petstore tests: tests: main: Test.hs 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 5fb889006a5..7255abfa1f6 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,10 +40,13 @@ 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 - , swagger-petstore + , safe-exceptions <0.2 , microlens , swagger-petstore + , swagger-petstore , bytestring >=0.10.0 && <0.11 , containers , hspec >=1.8 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 85c530af3e1..b1fe57c0793 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 @@ -237,7 +237,11 @@ testUserOps mgr config = do } _users = take 8 $ - drop 1 $ iterate (L.over S.userUsernameT (<> "*") . L.over S.userIdT (+ 1)) _user + drop 1 $ + iterate + (L.over (S.userUsernameL . L._Just) (<> "*") . + L.over (S.userIdL . L._Just) (+ 1)) + _user before (pure _user) $ it "createUser" $ \user -> do