forked from loafle/openapi-generator-original
Swagger parser update: 2.0.8-OpenAPITools.org-1 (#1721)
* Update Swagger-Parser Version * Update samples * surpress javadoc warning * fix TS tests * Set version to 2.0.8-OpenAPITools.org-1
This commit is contained in:
committed by
William Cheng
parent
43abd61144
commit
a7dfc650b6
@@ -67,15 +67,15 @@ import qualified Prelude as P
|
||||
--
|
||||
op123testSpecialTags
|
||||
:: (Consumes Op123testSpecialTags MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "client" - client model
|
||||
=> Client -- ^ "body" - client model
|
||||
-> OpenAPIPetstoreRequest Op123testSpecialTags MimeJSON Client MimeJSON
|
||||
op123testSpecialTags client =
|
||||
op123testSpecialTags body =
|
||||
_mkRequest "PATCH" ["/another-fake/dummy"]
|
||||
`setBodyParam` client
|
||||
`setBodyParam` body
|
||||
|
||||
data Op123testSpecialTags
|
||||
|
||||
-- | /Body Param/ "Client" - client model
|
||||
-- | /Body Param/ "body" - client model
|
||||
instance HasBodyParam Op123testSpecialTags Client
|
||||
|
||||
-- | @application/json@
|
||||
|
||||
@@ -96,7 +96,7 @@ fakeOuterCompositeSerialize _ _ =
|
||||
|
||||
data FakeOuterCompositeSerialize
|
||||
|
||||
-- | /Body Param/ "OuterComposite" - Input composite as post body
|
||||
-- | /Body Param/ "body" - Input composite as post body
|
||||
instance HasBodyParam FakeOuterCompositeSerialize OuterComposite
|
||||
|
||||
-- | @*/*@
|
||||
@@ -120,7 +120,7 @@ fakeOuterNumberSerialize _ _ =
|
||||
data FakeOuterNumberSerialize
|
||||
|
||||
-- | /Body Param/ "body" - Input number as post body
|
||||
instance HasBodyParam FakeOuterNumberSerialize Body
|
||||
instance HasBodyParam FakeOuterNumberSerialize BodyDouble
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterNumberSerialize mtype
|
||||
@@ -157,11 +157,11 @@ instance MimeType mtype => Produces FakeOuterStringSerialize mtype
|
||||
--
|
||||
testBodyWithFileSchema
|
||||
:: (Consumes TestBodyWithFileSchema MimeJSON, MimeRender MimeJSON FileSchemaTestClass)
|
||||
=> FileSchemaTestClass -- ^ "fileSchemaTestClass"
|
||||
=> FileSchemaTestClass -- ^ "body"
|
||||
-> OpenAPIPetstoreRequest TestBodyWithFileSchema MimeJSON NoContent MimeNoContent
|
||||
testBodyWithFileSchema fileSchemaTestClass =
|
||||
testBodyWithFileSchema body =
|
||||
_mkRequest "PUT" ["/fake/body-with-file-schema"]
|
||||
`setBodyParam` fileSchemaTestClass
|
||||
`setBodyParam` body
|
||||
|
||||
data TestBodyWithFileSchema
|
||||
instance HasBodyParam TestBodyWithFileSchema FileSchemaTestClass
|
||||
@@ -178,12 +178,12 @@ instance Produces TestBodyWithFileSchema MimeNoContent
|
||||
--
|
||||
testBodyWithQueryParams
|
||||
:: (Consumes TestBodyWithQueryParams MimeJSON, MimeRender MimeJSON User)
|
||||
=> User -- ^ "user"
|
||||
=> User -- ^ "body"
|
||||
-> Query -- ^ "query"
|
||||
-> OpenAPIPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent
|
||||
testBodyWithQueryParams user (Query query) =
|
||||
testBodyWithQueryParams body (Query query) =
|
||||
_mkRequest "PUT" ["/fake/body-with-query-params"]
|
||||
`setBodyParam` user
|
||||
`setBodyParam` body
|
||||
`setQuery` toQuery ("query", Just query)
|
||||
|
||||
data TestBodyWithQueryParams
|
||||
@@ -205,15 +205,15 @@ instance Produces TestBodyWithQueryParams MimeNoContent
|
||||
--
|
||||
testClientModel
|
||||
:: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "client" - client model
|
||||
=> Client -- ^ "body" - client model
|
||||
-> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON
|
||||
testClientModel client =
|
||||
testClientModel body =
|
||||
_mkRequest "PATCH" ["/fake"]
|
||||
`setBodyParam` client
|
||||
`setBodyParam` body
|
||||
|
||||
data TestClientModel
|
||||
|
||||
-- | /Body Param/ "Client" - client model
|
||||
-- | /Body Param/ "body" - client model
|
||||
instance HasBodyParam TestClientModel Client
|
||||
|
||||
-- | @application/json@
|
||||
@@ -414,17 +414,17 @@ instance Produces TestGroupParameters MimeNoContent
|
||||
-- test inline additionalProperties
|
||||
--
|
||||
testInlineAdditionalProperties
|
||||
:: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON RequestBody)
|
||||
=> RequestBody -- ^ "requestBody" - request body
|
||||
:: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON ParamMapMapStringText)
|
||||
=> ParamMapMapStringText -- ^ "param" - request body
|
||||
-> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent
|
||||
testInlineAdditionalProperties requestBody =
|
||||
testInlineAdditionalProperties param =
|
||||
_mkRequest "POST" ["/fake/inline-additionalProperties"]
|
||||
`setBodyParam` requestBody
|
||||
`setBodyParam` param
|
||||
|
||||
data TestInlineAdditionalProperties
|
||||
|
||||
-- | /Body Param/ "request_body" - request body
|
||||
instance HasBodyParam TestInlineAdditionalProperties RequestBody
|
||||
-- | /Body Param/ "param" - request body
|
||||
instance HasBodyParam TestInlineAdditionalProperties ParamMapMapStringText
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes TestInlineAdditionalProperties MimeJSON
|
||||
|
||||
@@ -69,16 +69,16 @@ import qualified Prelude as P
|
||||
--
|
||||
testClassname
|
||||
:: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "client" - client model
|
||||
=> Client -- ^ "body" - client model
|
||||
-> OpenAPIPetstoreRequest TestClassname MimeJSON Client MimeJSON
|
||||
testClassname client =
|
||||
testClassname body =
|
||||
_mkRequest "PATCH" ["/fake_classname_test"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery)
|
||||
`setBodyParam` client
|
||||
`setBodyParam` body
|
||||
|
||||
data TestClassname
|
||||
|
||||
-- | /Body Param/ "Client" - client model
|
||||
-- | /Body Param/ "body" - client model
|
||||
instance HasBodyParam TestClassname Client
|
||||
|
||||
-- | @application/json@
|
||||
|
||||
@@ -68,16 +68,16 @@ import qualified Prelude as P
|
||||
addPet
|
||||
:: (Consumes AddPet contentType, MimeRender contentType Pet)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Pet -- ^ "pet" - Pet object that needs to be added to the store
|
||||
-> Pet -- ^ "body" - Pet object that needs to be added to the store
|
||||
-> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent
|
||||
addPet _ pet =
|
||||
addPet _ body =
|
||||
_mkRequest "POST" ["/pet"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` pet
|
||||
`setBodyParam` body
|
||||
|
||||
data AddPet
|
||||
|
||||
-- | /Body Param/ "Pet" - Pet object that needs to be added to the store
|
||||
-- | /Body Param/ "body" - Pet object that needs to be added to the store
|
||||
instance HasBodyParam AddPet Pet
|
||||
|
||||
-- | @application/xml@
|
||||
@@ -204,16 +204,16 @@ instance Produces GetPetById MimeJSON
|
||||
updatePet
|
||||
:: (Consumes UpdatePet contentType, MimeRender contentType Pet)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Pet -- ^ "pet" - Pet object that needs to be added to the store
|
||||
-> Pet -- ^ "body" - Pet object that needs to be added to the store
|
||||
-> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent
|
||||
updatePet _ pet =
|
||||
updatePet _ body =
|
||||
_mkRequest "PUT" ["/pet"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` pet
|
||||
`setBodyParam` body
|
||||
|
||||
data UpdatePet
|
||||
|
||||
-- | /Body Param/ "Pet" - Pet object that needs to be added to the store
|
||||
-- | /Body Param/ "body" - Pet object that needs to be added to the store
|
||||
instance HasBodyParam UpdatePet Pet
|
||||
|
||||
-- | @application/xml@
|
||||
|
||||
@@ -131,15 +131,15 @@ placeOrder
|
||||
:: (Consumes PlaceOrder contentType, MimeRender contentType Order)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Order -- ^ "order" - order placed for purchasing the pet
|
||||
-> Order -- ^ "body" - order placed for purchasing the pet
|
||||
-> OpenAPIPetstoreRequest PlaceOrder contentType Order accept
|
||||
placeOrder _ _ order =
|
||||
placeOrder _ _ body =
|
||||
_mkRequest "POST" ["/store/order"]
|
||||
`setBodyParam` order
|
||||
`setBodyParam` body
|
||||
|
||||
data PlaceOrder
|
||||
|
||||
-- | /Body Param/ "Order" - order placed for purchasing the pet
|
||||
-- | /Body Param/ "body" - order placed for purchasing the pet
|
||||
instance HasBodyParam PlaceOrder Order
|
||||
|
||||
-- | @application/xml@
|
||||
|
||||
@@ -68,15 +68,15 @@ import qualified Prelude as P
|
||||
createUser
|
||||
:: (Consumes CreateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User -- ^ "user" - Created user object
|
||||
-> User -- ^ "body" - Created user object
|
||||
-> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent
|
||||
createUser _ user =
|
||||
createUser _ body =
|
||||
_mkRequest "POST" ["/user"]
|
||||
`setBodyParam` user
|
||||
`setBodyParam` body
|
||||
|
||||
data CreateUser
|
||||
|
||||
-- | /Body Param/ "User" - Created user object
|
||||
-- | /Body Param/ "body" - Created user object
|
||||
instance HasBodyParam CreateUser User
|
||||
|
||||
instance Produces CreateUser MimeNoContent
|
||||
@@ -89,18 +89,18 @@ instance Produces CreateUser MimeNoContent
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
createUsersWithArrayInput
|
||||
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType User2)
|
||||
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> Body -- ^ "body" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent
|
||||
createUsersWithArrayInput _ user =
|
||||
createUsersWithArrayInput _ body =
|
||||
_mkRequest "POST" ["/user/createWithArray"]
|
||||
`setBodyParam` user
|
||||
`setBodyParam` body
|
||||
|
||||
data CreateUsersWithArrayInput
|
||||
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithArrayInput User2
|
||||
-- | /Body Param/ "body" - List of user object
|
||||
instance HasBodyParam CreateUsersWithArrayInput Body
|
||||
|
||||
instance Produces CreateUsersWithArrayInput MimeNoContent
|
||||
|
||||
@@ -112,18 +112,18 @@ instance Produces CreateUsersWithArrayInput MimeNoContent
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
createUsersWithListInput
|
||||
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType User2)
|
||||
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> Body -- ^ "body" - List of user object
|
||||
-> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent
|
||||
createUsersWithListInput _ user =
|
||||
createUsersWithListInput _ body =
|
||||
_mkRequest "POST" ["/user/createWithList"]
|
||||
`setBodyParam` user
|
||||
`setBodyParam` body
|
||||
|
||||
data CreateUsersWithListInput
|
||||
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithListInput User2
|
||||
-- | /Body Param/ "body" - List of user object
|
||||
instance HasBodyParam CreateUsersWithListInput Body
|
||||
|
||||
instance Produces CreateUsersWithListInput MimeNoContent
|
||||
|
||||
@@ -219,16 +219,16 @@ instance Produces LogoutUser MimeNoContent
|
||||
updateUser
|
||||
:: (Consumes UpdateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> User -- ^ "user" - Updated user object
|
||||
-> User -- ^ "body" - Updated user object
|
||||
-> Username -- ^ "username" - name that need to be deleted
|
||||
-> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent
|
||||
updateUser _ user (Username username) =
|
||||
updateUser _ body (Username username) =
|
||||
_mkRequest "PUT" ["/user/",toPath username]
|
||||
`setBodyParam` user
|
||||
`setBodyParam` body
|
||||
|
||||
data UpdateUser
|
||||
|
||||
-- | /Body Param/ "User" - Updated user object
|
||||
-- | /Body Param/ "body" - Updated user object
|
||||
instance HasBodyParam UpdateUser User
|
||||
|
||||
instance Produces UpdateUser MimeNoContent
|
||||
|
||||
@@ -73,11 +73,14 @@ newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text }
|
||||
newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Body
|
||||
newtype Body = Body { unBody :: Double } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** BodyBool
|
||||
newtype BodyBool = BodyBool { unBodyBool :: Bool } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** BodyDouble
|
||||
newtype BodyDouble = BodyDouble { unBodyDouble :: Double } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** BodyText
|
||||
newtype BodyText = BodyText { unBodyText :: Text } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
@@ -162,6 +165,9 @@ newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show
|
||||
-- ** ParamInteger
|
||||
newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** ParamMapMapStringText
|
||||
newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** ParamString
|
||||
newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -177,9 +183,6 @@ 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)
|
||||
|
||||
-- ** RequiredBooleanGroup
|
||||
newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -204,9 +207,6 @@ newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Sho
|
||||
-- ** Tags
|
||||
newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** User2
|
||||
newtype User2 = User2 { unUser2 :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** Username
|
||||
newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user