mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 10:26:13 +00:00
fix(swift3): decoders call parents decoders too (#5433)
This commit is contained in:
@@ -45,9 +45,9 @@ open class FakeAPI: APIBase {
|
||||
To test \"client\" model
|
||||
- PATCH /fake
|
||||
- To test \"client\" model
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"client" : "aeiou"
|
||||
}}]
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter body: (body) client model
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ open class Fake_classname_tags123API: APIBase {
|
||||
/**
|
||||
To test class name in snake case
|
||||
- PATCH /fake_classname_test
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"client" : "aeiou"
|
||||
}}]
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter body: (body) client model
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ open class PetAPI: APIBase {
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -184,21 +184,21 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
} ]}]
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}]
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -207,20 +207,20 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
} ]}]
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}]
|
||||
|
||||
- parameter status: (query) Status values that need to be considered for filter
|
||||
|
||||
@@ -279,7 +279,7 @@ open class PetAPI: APIBase {
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -288,21 +288,21 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
} ]}]
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}]
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -311,20 +311,20 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example=[ {
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example=[ {
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
} ]}]
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
} ], contentType=application/json}]
|
||||
|
||||
- parameter tags: (query) Tags to filter by
|
||||
|
||||
@@ -383,7 +383,7 @@ open class PetAPI: APIBase {
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -392,21 +392,21 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example={
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
}}]
|
||||
- examples: [{contentType=application/xml, example=<Pet>
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}]
|
||||
- examples: [{example=<Pet>
|
||||
<id>123456789</id>
|
||||
<name>doggie</name>
|
||||
<photoUrls>
|
||||
@@ -415,20 +415,20 @@ open class PetAPI: APIBase {
|
||||
<tags>
|
||||
</tags>
|
||||
<status>aeiou</status>
|
||||
</Pet>}, {contentType=application/json, example={
|
||||
"photoUrls" : [ "aeiou" ],
|
||||
"name" : "doggie",
|
||||
</Pet>, contentType=application/xml}, {example={
|
||||
"tags" : [ {
|
||||
"id" : 1,
|
||||
"name" : "aeiou"
|
||||
} ],
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "aeiou",
|
||||
"id" : 6
|
||||
"id" : 6,
|
||||
"name" : "aeiou"
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "aeiou",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
}}]
|
||||
"status" : "available",
|
||||
"name" : "doggie",
|
||||
"photoUrls" : [ "aeiou" ]
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter petId: (path) ID of pet to return
|
||||
|
||||
@@ -612,11 +612,11 @@ open class PetAPI: APIBase {
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"message" : "aeiou",
|
||||
"code" : 0,
|
||||
"type" : "aeiou",
|
||||
"message" : "aeiou"
|
||||
}}]
|
||||
"type" : "aeiou"
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter petId: (path) ID of pet to update
|
||||
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
|
||||
|
||||
@@ -99,9 +99,9 @@ open class StoreAPI: APIBase {
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- examples: [{contentType=application/json, example={
|
||||
- examples: [{example={
|
||||
"key" : 0
|
||||
}}]
|
||||
}, contentType=application/json}]
|
||||
|
||||
- returns: RequestBuilder<[String:Int32]>
|
||||
*/
|
||||
@@ -152,36 +152,36 @@ open class StoreAPI: APIBase {
|
||||
Find purchase order by ID
|
||||
- GET /store/order/{order_id}
|
||||
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
- examples: [{contentType=application/xml, example=<Order>
|
||||
- examples: [{example=<Order>
|
||||
<id>123456789</id>
|
||||
<petId>123456789</petId>
|
||||
<quantity>123</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>aeiou</status>
|
||||
<complete>true</complete>
|
||||
</Order>}, {contentType=application/json, example={
|
||||
"petId" : 6,
|
||||
"quantity" : 1,
|
||||
</Order>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00",
|
||||
"petId" : 6,
|
||||
"complete" : false,
|
||||
"status" : "placed"
|
||||
}}]
|
||||
- examples: [{contentType=application/xml, example=<Order>
|
||||
"status" : "placed",
|
||||
"quantity" : 1,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00"
|
||||
}, contentType=application/json}]
|
||||
- examples: [{example=<Order>
|
||||
<id>123456789</id>
|
||||
<petId>123456789</petId>
|
||||
<quantity>123</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>aeiou</status>
|
||||
<complete>true</complete>
|
||||
</Order>}, {contentType=application/json, example={
|
||||
"petId" : 6,
|
||||
"quantity" : 1,
|
||||
</Order>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00",
|
||||
"petId" : 6,
|
||||
"complete" : false,
|
||||
"status" : "placed"
|
||||
}}]
|
||||
"status" : "placed",
|
||||
"quantity" : 1,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00"
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
|
||||
@@ -235,36 +235,36 @@ open class StoreAPI: APIBase {
|
||||
Place an order for a pet
|
||||
- POST /store/order
|
||||
-
|
||||
- examples: [{contentType=application/xml, example=<Order>
|
||||
- examples: [{example=<Order>
|
||||
<id>123456789</id>
|
||||
<petId>123456789</petId>
|
||||
<quantity>123</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>aeiou</status>
|
||||
<complete>true</complete>
|
||||
</Order>}, {contentType=application/json, example={
|
||||
"petId" : 6,
|
||||
"quantity" : 1,
|
||||
</Order>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00",
|
||||
"petId" : 6,
|
||||
"complete" : false,
|
||||
"status" : "placed"
|
||||
}}]
|
||||
- examples: [{contentType=application/xml, example=<Order>
|
||||
"status" : "placed",
|
||||
"quantity" : 1,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00"
|
||||
}, contentType=application/json}]
|
||||
- examples: [{example=<Order>
|
||||
<id>123456789</id>
|
||||
<petId>123456789</petId>
|
||||
<quantity>123</quantity>
|
||||
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
|
||||
<status>aeiou</status>
|
||||
<complete>true</complete>
|
||||
</Order>}, {contentType=application/json, example={
|
||||
"petId" : 6,
|
||||
"quantity" : 1,
|
||||
</Order>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00",
|
||||
"petId" : 6,
|
||||
"complete" : false,
|
||||
"status" : "placed"
|
||||
}}]
|
||||
"status" : "placed",
|
||||
"quantity" : 1,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+00:00"
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter body: (body) order placed for purchasing the pet
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ open class UserAPI: APIBase {
|
||||
Get user by user name
|
||||
- GET /user/{username}
|
||||
-
|
||||
- examples: [{contentType=application/xml, example=<User>
|
||||
- examples: [{example=<User>
|
||||
<id>123456789</id>
|
||||
<username>aeiou</username>
|
||||
<firstName>aeiou</firstName>
|
||||
@@ -263,17 +263,17 @@ open class UserAPI: APIBase {
|
||||
<password>aeiou</password>
|
||||
<phone>aeiou</phone>
|
||||
<userStatus>123</userStatus>
|
||||
</User>}, {contentType=application/json, example={
|
||||
"firstName" : "aeiou",
|
||||
"lastName" : "aeiou",
|
||||
"password" : "aeiou",
|
||||
"userStatus" : 6,
|
||||
"phone" : "aeiou",
|
||||
</User>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"lastName" : "aeiou",
|
||||
"phone" : "aeiou",
|
||||
"username" : "aeiou",
|
||||
"email" : "aeiou",
|
||||
"username" : "aeiou"
|
||||
}}]
|
||||
- examples: [{contentType=application/xml, example=<User>
|
||||
"userStatus" : 6,
|
||||
"firstName" : "aeiou",
|
||||
"password" : "aeiou"
|
||||
}, contentType=application/json}]
|
||||
- examples: [{example=<User>
|
||||
<id>123456789</id>
|
||||
<username>aeiou</username>
|
||||
<firstName>aeiou</firstName>
|
||||
@@ -282,16 +282,16 @@ open class UserAPI: APIBase {
|
||||
<password>aeiou</password>
|
||||
<phone>aeiou</phone>
|
||||
<userStatus>123</userStatus>
|
||||
</User>}, {contentType=application/json, example={
|
||||
"firstName" : "aeiou",
|
||||
"lastName" : "aeiou",
|
||||
"password" : "aeiou",
|
||||
"userStatus" : 6,
|
||||
"phone" : "aeiou",
|
||||
</User>, contentType=application/xml}, {example={
|
||||
"id" : 0,
|
||||
"lastName" : "aeiou",
|
||||
"phone" : "aeiou",
|
||||
"username" : "aeiou",
|
||||
"email" : "aeiou",
|
||||
"username" : "aeiou"
|
||||
}}]
|
||||
"userStatus" : 6,
|
||||
"firstName" : "aeiou",
|
||||
"password" : "aeiou"
|
||||
}, contentType=application/json}]
|
||||
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
@@ -349,8 +349,8 @@ open class UserAPI: APIBase {
|
||||
-
|
||||
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
|
||||
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
|
||||
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
||||
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
||||
- examples: [{example=aeiou, contentType=application/xml}, {example="aeiou", contentType=application/json}]
|
||||
- examples: [{example=aeiou, contentType=application/xml}, {example="aeiou", contentType=application/json}]
|
||||
|
||||
- parameter username: (query) The user name for login
|
||||
- parameter password: (query) The password for login in clear text
|
||||
|
||||
@@ -197,7 +197,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
if let json: Any = response.result.value {
|
||||
let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject)
|
||||
let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil)
|
||||
switch decoded {
|
||||
case let .success(object): completion(Response(response: response.response!, body: object), nil)
|
||||
case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user