forked from loafle/openapi-generator-original
[haskell-http-client] update samples (OAS3) (#381)
This commit is contained in:
committed by
William Cheng
parent
4fd68f0f24
commit
68780afe9d
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
@@ -64,11 +64,10 @@ import qualified Prelude as P
|
||||
-- Test serialization of outer boolean types
|
||||
--
|
||||
fakeOuterBooleanSerialize
|
||||
:: (Consumes FakeOuterBooleanSerialize contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept
|
||||
fakeOuterBooleanSerialize _ _ =
|
||||
:: (Consumes FakeOuterBooleanSerialize MimeJSON)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterBooleanSerialize MimeJSON Bool accept
|
||||
fakeOuterBooleanSerialize _ =
|
||||
_mkRequest "POST" ["/fake/outer/boolean"]
|
||||
|
||||
data FakeOuterBooleanSerialize
|
||||
@@ -76,6 +75,9 @@ data FakeOuterBooleanSerialize
|
||||
-- | /Body Param/ "body" - Input boolean as post body
|
||||
instance HasBodyParam FakeOuterBooleanSerialize BodyBool
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes FakeOuterBooleanSerialize MimeJSON
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype
|
||||
|
||||
@@ -87,11 +89,10 @@ instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype
|
||||
-- Test serialization of object with outer number type
|
||||
--
|
||||
fakeOuterCompositeSerialize
|
||||
:: (Consumes FakeOuterCompositeSerialize contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept
|
||||
fakeOuterCompositeSerialize _ _ =
|
||||
:: (Consumes FakeOuterCompositeSerialize MimeJSON)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterCompositeSerialize MimeJSON OuterComposite accept
|
||||
fakeOuterCompositeSerialize _ =
|
||||
_mkRequest "POST" ["/fake/outer/composite"]
|
||||
|
||||
data FakeOuterCompositeSerialize
|
||||
@@ -99,6 +100,9 @@ data FakeOuterCompositeSerialize
|
||||
-- | /Body Param/ "OuterComposite" - Input composite as post body
|
||||
instance HasBodyParam FakeOuterCompositeSerialize OuterComposite
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes FakeOuterCompositeSerialize MimeJSON
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype
|
||||
|
||||
@@ -110,11 +114,10 @@ instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype
|
||||
-- Test serialization of outer number types
|
||||
--
|
||||
fakeOuterNumberSerialize
|
||||
:: (Consumes FakeOuterNumberSerialize contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept
|
||||
fakeOuterNumberSerialize _ _ =
|
||||
:: (Consumes FakeOuterNumberSerialize MimeJSON)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterNumberSerialize MimeJSON Double accept
|
||||
fakeOuterNumberSerialize _ =
|
||||
_mkRequest "POST" ["/fake/outer/number"]
|
||||
|
||||
data FakeOuterNumberSerialize
|
||||
@@ -122,6 +125,9 @@ data FakeOuterNumberSerialize
|
||||
-- | /Body Param/ "body" - Input number as post body
|
||||
instance HasBodyParam FakeOuterNumberSerialize Body
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes FakeOuterNumberSerialize MimeJSON
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterNumberSerialize mtype
|
||||
|
||||
@@ -133,11 +139,10 @@ instance MimeType mtype => Produces FakeOuterNumberSerialize mtype
|
||||
-- Test serialization of outer string types
|
||||
--
|
||||
fakeOuterStringSerialize
|
||||
:: (Consumes FakeOuterStringSerialize contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept
|
||||
fakeOuterStringSerialize _ _ =
|
||||
:: (Consumes FakeOuterStringSerialize MimeJSON)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> OpenAPIPetstoreRequest FakeOuterStringSerialize MimeJSON Text accept
|
||||
fakeOuterStringSerialize _ =
|
||||
_mkRequest "POST" ["/fake/outer/string"]
|
||||
|
||||
data FakeOuterStringSerialize
|
||||
@@ -145,33 +150,13 @@ data FakeOuterStringSerialize
|
||||
-- | /Body Param/ "body" - Input string as post body
|
||||
instance HasBodyParam FakeOuterStringSerialize BodyText
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes FakeOuterStringSerialize MimeJSON
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterStringSerialize mtype
|
||||
|
||||
|
||||
-- *** testBodyWithQueryParams
|
||||
|
||||
-- | @PUT \/fake\/body-with-query-params@
|
||||
--
|
||||
testBodyWithQueryParams
|
||||
:: (Consumes TestBodyWithQueryParams MimeJSON, MimeRender MimeJSON User)
|
||||
=> User -- ^ "user"
|
||||
-> Query -- ^ "query"
|
||||
-> OpenAPIPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent
|
||||
testBodyWithQueryParams user (Query query) =
|
||||
_mkRequest "PUT" ["/fake/body-with-query-params"]
|
||||
`setBodyParam` user
|
||||
`setQuery` toQuery ("query", Just query)
|
||||
|
||||
data TestBodyWithQueryParams
|
||||
instance HasBodyParam TestBodyWithQueryParams User
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes TestBodyWithQueryParams MimeJSON
|
||||
|
||||
instance Produces TestBodyWithQueryParams MimeNoContent
|
||||
|
||||
|
||||
-- *** testClientModel
|
||||
|
||||
-- | @PATCH \/fake@
|
||||
@@ -322,7 +307,7 @@ instance HasOptionalParam TestEnumParameters EnumHeaderString where
|
||||
-- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array)
|
||||
instance HasOptionalParam TestEnumParameters EnumQueryStringArray where
|
||||
applyOptionalParam req (EnumQueryStringArray xs) =
|
||||
req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs)
|
||||
req `setQuery` toQueryColl MultiParamArray ("enum_query_string_array", Just xs)
|
||||
|
||||
-- | /Optional Param/ "enum_query_string" - Query parameter enum test (string)
|
||||
instance HasOptionalParam TestEnumParameters EnumQueryString where
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
@@ -128,12 +128,11 @@ instance Produces GetOrderById MimeJSON
|
||||
-- Place an order for a pet
|
||||
--
|
||||
placeOrder
|
||||
:: (Consumes PlaceOrder contentType, MimeRender contentType Order)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
:: (Consumes PlaceOrder MimeJSON, MimeRender MimeJSON Order)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Order -- ^ "order" - order placed for purchasing the pet
|
||||
-> OpenAPIPetstoreRequest PlaceOrder contentType Order accept
|
||||
placeOrder _ _ order =
|
||||
-> OpenAPIPetstoreRequest PlaceOrder MimeJSON Order accept
|
||||
placeOrder _ order =
|
||||
_mkRequest "POST" ["/store/order"]
|
||||
`setBodyParam` order
|
||||
|
||||
@@ -142,6 +141,9 @@ data PlaceOrder
|
||||
-- | /Body Param/ "Order" - order placed for purchasing the pet
|
||||
instance HasBodyParam PlaceOrder Order
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes PlaceOrder MimeJSON
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces PlaceOrder MimeXML
|
||||
-- | @application/json@
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
@@ -66,11 +66,10 @@ import qualified Prelude as P
|
||||
-- This can only be done by the logged in user.
|
||||
--
|
||||
createUser
|
||||
:: (Consumes CreateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User -- ^ "user" - Created user object
|
||||
-> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent
|
||||
createUser _ user =
|
||||
:: (Consumes CreateUser MimeJSON, MimeRender MimeJSON User)
|
||||
=> User -- ^ "user" - Created user object
|
||||
-> OpenAPIPetstoreRequest CreateUser MimeJSON NoContent MimeNoContent
|
||||
createUser user =
|
||||
_mkRequest "POST" ["/user"]
|
||||
`setBodyParam` user
|
||||
|
||||
@@ -79,6 +78,9 @@ data CreateUser
|
||||
-- | /Body Param/ "User" - Created user object
|
||||
instance HasBodyParam CreateUser User
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes CreateUser MimeJSON
|
||||
|
||||
instance Produces CreateUser MimeNoContent
|
||||
|
||||
|
||||
@@ -89,11 +91,10 @@ instance Produces CreateUser MimeNoContent
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
createUsersWithArrayInput
|
||||
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType User2)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent
|
||||
createUsersWithArrayInput _ user =
|
||||
:: (Consumes CreateUsersWithArrayInput MimeJSON, MimeRender MimeJSON User2)
|
||||
=> User2 -- ^ "user" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithArrayInput MimeJSON NoContent MimeNoContent
|
||||
createUsersWithArrayInput user =
|
||||
_mkRequest "POST" ["/user/createWithArray"]
|
||||
`setBodyParam` user
|
||||
|
||||
@@ -102,6 +103,9 @@ data CreateUsersWithArrayInput
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithArrayInput User2
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes CreateUsersWithArrayInput MimeJSON
|
||||
|
||||
instance Produces CreateUsersWithArrayInput MimeNoContent
|
||||
|
||||
|
||||
@@ -112,11 +116,10 @@ instance Produces CreateUsersWithArrayInput MimeNoContent
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
createUsersWithListInput
|
||||
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType User2)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent
|
||||
createUsersWithListInput _ user =
|
||||
:: (Consumes CreateUsersWithListInput MimeJSON, MimeRender MimeJSON User2)
|
||||
=> User2 -- ^ "user" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithListInput MimeJSON NoContent MimeNoContent
|
||||
createUsersWithListInput user =
|
||||
_mkRequest "POST" ["/user/createWithList"]
|
||||
`setBodyParam` user
|
||||
|
||||
@@ -125,6 +128,9 @@ data CreateUsersWithListInput
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithListInput User2
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes CreateUsersWithListInput MimeJSON
|
||||
|
||||
instance Produces CreateUsersWithListInput MimeNoContent
|
||||
|
||||
|
||||
@@ -217,12 +223,11 @@ instance Produces LogoutUser MimeNoContent
|
||||
-- This can only be done by the logged in user.
|
||||
--
|
||||
updateUser
|
||||
:: (Consumes UpdateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User -- ^ "user" - Updated user object
|
||||
:: (Consumes UpdateUser MimeJSON, MimeRender MimeJSON User)
|
||||
=> User -- ^ "user" - Updated user object
|
||||
-> Username -- ^ "username" - name that need to be deleted
|
||||
-> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent
|
||||
updateUser _ user (Username username) =
|
||||
-> OpenAPIPetstoreRequest UpdateUser MimeJSON NoContent MimeNoContent
|
||||
updateUser user (Username username) =
|
||||
_mkRequest "PUT" ["/user/",toPath username]
|
||||
`setBodyParam` user
|
||||
|
||||
@@ -231,5 +236,8 @@ data UpdateUser
|
||||
-- | /Body Param/ "User" - Updated user object
|
||||
instance HasBodyParam UpdateUser User
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes UpdateUser MimeJSON
|
||||
|
||||
instance Produces UpdateUser MimeNoContent
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
@@ -91,7 +91,7 @@ newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumFormStringArray
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: E'EnumFormStringArray } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumHeaderString
|
||||
newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
@@ -168,9 +168,6 @@ newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDeli
|
||||
-- ** PetId
|
||||
newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Query
|
||||
newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** RequestBody
|
||||
newtype RequestBody = RequestBody { unRequestBody :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI Version: 3.0.1
|
||||
OpenAPI Version: 3.0.0
|
||||
OpenAPI Petstore API version: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
-}
|
||||
|
||||
Reference in New Issue
Block a user