remove dateOfBirth from petstore.json

This commit is contained in:
wing328 2016-10-07 16:20:53 +08:00
parent f639a312e8
commit b09f4b66ff
18 changed files with 355 additions and 340 deletions

View File

@ -833,10 +833,6 @@
"username": {
"type": "string"
},
"dateOfBirth": {
"type": "string",
"format": "date"
},
"firstName": {
"type": "string"
},

View File

@ -108,13 +108,13 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
- examples: [{example={
"name" : "Puma",
"type" : "Dog",
"color" : "Black",
"gender" : "Female",
"breed" : "Mixed"
}}]
}, contentType=application/json}]
- parameter status: (query) Status values that need to be considered for filter (optional, default to available)
@ -157,20 +157,20 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -179,21 +179,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -202,7 +202,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter tags: (query) Tags to filter by (optional)
@ -242,26 +242,26 @@ public class PetAPI: APIBase {
Find pet by ID
- GET /pet/{petId}
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- OAuth:
- type: oauth2
- name: petstore_auth
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -270,21 +270,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -293,7 +293,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter petId: (path) ID of pet that needs to be fetched

View File

@ -67,12 +67,12 @@ public class StoreAPI: APIBase {
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
- examples: [{contentType=application/json, example={
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- returns: RequestBuilder<[String:Int32]>
*/
@ -108,36 +108,36 @@ public class StoreAPI: APIBase {
Find purchase order by ID
- GET /store/order/{orderId}
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter orderId: (path) ID of pet that needs to be fetched
@ -176,36 +176,36 @@ public class StoreAPI: APIBase {
Place an order for a pet
- POST /store/order
-
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter body: (body) order placed for purchasing the pet (optional)

View File

@ -167,46 +167,44 @@ public class UserAPI: APIBase {
Get user by user name
- GET /user/{username}
-
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
</User>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
</User>, contentType=application/xml}]
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
@ -246,8 +244,8 @@ public class UserAPI: APIBase {
Logs user into the system
- GET /user/login
-
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- parameter username: (query) The user name for login (optional)
- parameter password: (query) The password for login in clear text (optional)

View File

@ -224,7 +224,6 @@ class Decoders {
let instance = User()
instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"])
instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"])
instance.dateOfBirth = Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["dateOfBirth"])
instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"])
instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"])
instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"])

View File

@ -11,7 +11,6 @@ import Foundation
public class User: JSONEncodable {
public var id: Int64?
public var username: String?
public var dateOfBirth: ISOFullDate?
public var firstName: String?
public var lastName: String?
public var email: String?
@ -27,7 +26,6 @@ public class User: JSONEncodable {
var nillableDictionary = [String:AnyObject?]()
nillableDictionary["id"] = self.id?.encodeToJSON()
nillableDictionary["username"] = self.username
nillableDictionary["dateOfBirth"] = self.dateOfBirth?.encodeToJSON()
nillableDictionary["firstName"] = self.firstName
nillableDictionary["lastName"] = self.lastName
nillableDictionary["email"] = self.email

View File

@ -146,7 +146,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */;
buildPhases = (
A16DAFA9EF474E5065B5B1C2 /* 📦 Check Pods Manifest.lock */,
6345B531824FA2069A72B604 /* 📦 Check Pods Manifest.lock */,
CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */,
1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */,
6D4EFB8D1C692C6300B96B06 /* Sources */,
@ -170,7 +170,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */;
buildPhases = (
FE27E864CEDDA2D12F7972B1 /* 📦 Check Pods Manifest.lock */,
5B23A28C59366E7C8D31550A /* 📦 Check Pods Manifest.lock */,
B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */,
79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */,
6D4EFBA11C692C6300B96B06 /* Sources */,
@ -325,6 +325,36 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5B23A28C59366E7C8D31550A /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
6345B531824FA2069A72B604 /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
796EAD48F1BCCDAA291CD963 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@ -49,7 +49,10 @@ class UserAPITests: XCTestCase {
let newUser = User()
newUser.email = "test@test.com"
newUser.dateOfBirth = ISOFullDate.from(string: "1999-12-31")
// TODO comment out the following as dateOfBirth has been removed
// from petstore.json, we'll need to add back the test after switching
// to petstore-with-fake-endpoints-models-for-testing.yaml
////newUser.dateOfBirth = ISOFullDate.from(string: "1999-12-31")
newUser.firstName = "Test"
newUser.lastName = "Tester"
newUser.id = 1000
@ -86,7 +89,10 @@ class UserAPITests: XCTestCase {
XCTAssert(user.lastName == "Tester", "invalid lastName")
XCTAssert(user.password == "test!", "invalid password")
XCTAssert(user.phone == "867-5309", "invalid phone")
XCTAssert(user.dateOfBirth?.description == "1999-12-31", "invalid date of birth")
// TODO comment out the following as dateOfBirth has been removed
// from petstore.json, we'll need to add back the test after switching
// to petstore-with-fake-endpoints-models-for-testing.yaml
//XCTAssert(user.dateOfBirth?.description == "1999-12-31", "invalid date of birth")
expectation.fulfill()
}

View File

@ -160,13 +160,13 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
- examples: [{example={
"name" : "Puma",
"type" : "Dog",
"color" : "Black",
"gender" : "Female",
"breed" : "Mixed"
}}]
}, contentType=application/json}]
- parameter status: (query) Status values that need to be considered for filter (optional, default to available)
@ -226,20 +226,20 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -248,21 +248,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -271,7 +271,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter tags: (query) Tags to filter by (optional)
@ -328,26 +328,26 @@ public class PetAPI: APIBase {
Find pet by ID
- GET /pet/{petId}
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- OAuth:
- type: oauth2
- name: petstore_auth
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -356,21 +356,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -379,7 +379,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter petId: (path) ID of pet that needs to be fetched

View File

@ -101,12 +101,12 @@ public class StoreAPI: APIBase {
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
- examples: [{contentType=application/json, example={
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- returns: RequestBuilder<[String:Int32]>
*/
@ -159,36 +159,36 @@ public class StoreAPI: APIBase {
Find purchase order by ID
- GET /store/order/{orderId}
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter orderId: (path) ID of pet that needs to be fetched
@ -244,36 +244,36 @@ public class StoreAPI: APIBase {
Place an order for a pet
- POST /store/order
-
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter body: (body) order placed for purchasing the pet (optional)

View File

@ -253,48 +253,44 @@ public class UserAPI: APIBase {
Get user by user name
- GET /user/{username}
-
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
"dateOfBirth" : "2000-01-23T04:56:07.000+00:00",
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
"dateOfBirth" : "2000-01-23T04:56:07.000+00:00",
</User>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
</User>, contentType=application/xml}]
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
@ -352,8 +348,8 @@ public class UserAPI: APIBase {
Logs user into the system
- GET /user/login
-
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- parameter username: (query) The user name for login (optional)
- parameter password: (query) The password for login in clear text (optional)

View File

@ -224,7 +224,6 @@ class Decoders {
let instance = User()
instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"])
instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"])
instance.dateOfBirth = Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["dateOfBirth"])
instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"])
instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"])
instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"])

View File

@ -11,7 +11,6 @@ import Foundation
public class User: JSONEncodable {
public var id: Int64?
public var username: String?
public var dateOfBirth: ISOFullDate?
public var firstName: String?
public var lastName: String?
public var email: String?
@ -27,7 +26,6 @@ public class User: JSONEncodable {
var nillableDictionary = [String:AnyObject?]()
nillableDictionary["id"] = self.id?.encodeToJSON()
nillableDictionary["username"] = self.username
nillableDictionary["dateOfBirth"] = self.dateOfBirth?.encodeToJSON()
nillableDictionary["firstName"] = self.firstName
nillableDictionary["lastName"] = self.lastName
nillableDictionary["email"] = self.email

View File

@ -166,13 +166,13 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
- examples: [{example={
"name" : "Puma",
"type" : "Dog",
"color" : "Black",
"gender" : "Female",
"breed" : "Mixed"
}}]
}, contentType=application/json}]
- parameter status: (query) Status values that need to be considered for filter (optional, default to available)
@ -234,20 +234,20 @@ public class PetAPI: APIBase {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -256,21 +256,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example=[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example=[ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ]}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ], contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -279,7 +279,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter tags: (query) Tags to filter by (optional)
@ -338,26 +338,26 @@ public class PetAPI: APIBase {
Find pet by ID
- GET /pet/{petId}
- Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- OAuth:
- type: oauth2
- name: petstore_auth
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -366,21 +366,21 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
- examples: [{contentType=application/json, example={
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
</Pet>, contentType=application/xml}]
- examples: [{example={
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
}}, {contentType=application/xml, example=<Pet>
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}, contentType=application/json}, {example=<Pet>
<id>123456</id>
<name>doggie</name>
<photoUrls>
@ -389,7 +389,7 @@ public class PetAPI: APIBase {
<tags>
</tags>
<status>string</status>
</Pet>}]
</Pet>, contentType=application/xml}]
- parameter petId: (path) ID of pet that needs to be fetched

View File

@ -105,12 +105,12 @@ public class StoreAPI: APIBase {
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
- examples: [{contentType=application/json, example={
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- examples: [{example={
"key" : 123
}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}]
- returns: RequestBuilder<[String:Int32]>
*/
@ -165,36 +165,36 @@ public class StoreAPI: APIBase {
Find purchase order by ID
- GET /store/order/{orderId}
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter orderId: (path) ID of pet that needs to be fetched
@ -252,36 +252,36 @@ public class StoreAPI: APIBase {
Place an order for a pet
- POST /store/order
-
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
- examples: [{contentType=application/json, example={
"petId" : 123456789,
"quantity" : 123,
</Order>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
}}, {contentType=application/xml, example=<Order>
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}, contentType=application/json}, {example=<Order>
<id>123456</id>
<petId>123456</petId>
<quantity>0</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>string</status>
<complete>true</complete>
</Order>}]
</Order>, contentType=application/xml}]
- parameter body: (body) order placed for purchasing the pet (optional)

View File

@ -263,46 +263,44 @@ public class UserAPI: APIBase {
Get user by user name
- GET /user/{username}
-
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
- examples: [{contentType=application/json, example={
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
</User>, contentType=application/xml}]
- examples: [{example={
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
}}, {contentType=application/xml, example=<User>
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}, contentType=application/json}, {example=<User>
<id>123456</id>
<username>string</username>
<dateOfBirth>2000-01-23T04:56:07.000Z</dateOfBirth>
<firstName>string</firstName>
<lastName>string</lastName>
<email>string</email>
<password>string</password>
<phone>string</phone>
<userStatus>0</userStatus>
</User>}]
</User>, contentType=application/xml}]
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
@ -362,8 +360,8 @@ public class UserAPI: APIBase {
Logs user into the system
- GET /user/login
-
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}]
- parameter username: (query) The user name for login (optional)
- parameter password: (query) The password for login in clear text (optional)

View File

@ -224,7 +224,6 @@ class Decoders {
let instance = User()
instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"])
instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"])
instance.dateOfBirth = Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["dateOfBirth"])
instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"])
instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"])
instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"])

View File

@ -11,7 +11,6 @@ import Foundation
public class User: JSONEncodable {
public var id: Int64?
public var username: String?
public var dateOfBirth: ISOFullDate?
public var firstName: String?
public var lastName: String?
public var email: String?
@ -27,7 +26,6 @@ public class User: JSONEncodable {
var nillableDictionary = [String:AnyObject?]()
nillableDictionary["id"] = self.id?.encodeToJSON()
nillableDictionary["username"] = self.username
nillableDictionary["dateOfBirth"] = self.dateOfBirth?.encodeToJSON()
nillableDictionary["firstName"] = self.firstName
nillableDictionary["lastName"] = self.lastName
nillableDictionary["email"] = self.email