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:
Jérémie Bresson
2018-12-22 11:12:08 +01:00
committed by William Cheng
parent 43abd61144
commit a7dfc650b6
715 changed files with 6588 additions and 6470 deletions

View File

@@ -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@

View File

@@ -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

View File

@@ -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@

View File

@@ -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@

View File

@@ -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@

View File

@@ -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

View File

@@ -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)

View File

@@ -42,6 +42,7 @@ paths:
summary: Add a new pet to the store
tags:
- pet
x-codegen-request-body-name: body
put:
operationId: updatePet
requestBody:
@@ -71,6 +72,7 @@ paths:
summary: Update an existing pet
tags:
- pet
x-codegen-request-body-name: body
/pet/findByStatus:
get:
description: Multiple status values can be provided with comma separated strings
@@ -327,6 +329,7 @@ paths:
summary: Place an order for a pet
tags:
- store
x-codegen-request-body-name: body
/store/order/{order_id}:
delete:
description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
@@ -398,6 +401,7 @@ paths:
summary: Create user
tags:
- user
x-codegen-request-body-name: body
/user/createWithArray:
post:
operationId: createUsersWithArrayInput
@@ -417,6 +421,7 @@ paths:
summary: Creates list of users with given input array
tags:
- user
x-codegen-request-body-name: body
/user/createWithList:
post:
operationId: createUsersWithListInput
@@ -436,6 +441,7 @@ paths:
summary: Creates list of users with given input array
tags:
- user
x-codegen-request-body-name: body
/user/login:
get:
operationId: loginUser
@@ -565,6 +571,7 @@ paths:
summary: Updated user
tags:
- user
x-codegen-request-body-name: body
/fake_classname_test:
patch:
description: To test class name in snake case
@@ -588,6 +595,7 @@ paths:
summary: To test class name in snake case
tags:
- fake_classname_tags 123#$%^
x-codegen-request-body-name: body
/fake:
delete:
description: Fake endpoint to test group parameters (optional)
@@ -756,6 +764,7 @@ paths:
summary: To test "client" model
tags:
- fake
x-codegen-request-body-name: body
post:
description: |
Fake endpoint for testing various parameters
@@ -874,6 +883,7 @@ paths:
description: Output number
tags:
- fake
x-codegen-request-body-name: body
/fake/outer/string:
post:
description: Test serialization of outer string types
@@ -894,6 +904,7 @@ paths:
description: Output string
tags:
- fake
x-codegen-request-body-name: body
/fake/outer/boolean:
post:
description: Test serialization of outer boolean types
@@ -914,6 +925,7 @@ paths:
description: Output boolean
tags:
- fake
x-codegen-request-body-name: body
/fake/outer/composite:
post:
description: Test serialization of object with outer number type
@@ -934,6 +946,7 @@ paths:
description: Output composite
tags:
- fake
x-codegen-request-body-name: body
/fake/jsonFormData:
get:
operationId: testJsonFormData
@@ -978,6 +991,7 @@ paths:
summary: test inline additionalProperties
tags:
- fake
x-codegen-request-body-name: param
/fake/body-with-query-params:
put:
operationId: testBodyWithQueryParams
@@ -999,6 +1013,7 @@ paths:
description: Success
tags:
- fake
x-codegen-request-body-name: body
/another-fake/dummy:
patch:
description: To test special tags and operation ID starting with number
@@ -1020,6 +1035,7 @@ paths:
summary: To test special tags
tags:
- $another-fake?
x-codegen-request-body-name: body
/fake/body-with-file-schema:
put:
description: For this test, the body for this request much reference a schema named `File`.
@@ -1036,6 +1052,7 @@ paths:
description: Success
tags:
- fake
x-codegen-request-body-name: body
/fake/{petId}/uploadImageWithRequiredFile:
post:
operationId: uploadFileWithRequiredFile