Skip to content

Instantly share code, notes, and snippets.

@TheMightyLlama
Last active September 13, 2016 23:24
Show Gist options
  • Save TheMightyLlama/cf0267ccd86d5afe41586f14ae67ecef to your computer and use it in GitHub Desktop.
Save TheMightyLlama/cf0267ccd86d5afe41586f14ae67ecef to your computer and use it in GitHub Desktop.
For proper splitting of objects see here: http://stackoverflow.com/questions/7460934/best-practices-in-retrieving-related-data-in-a-rest-api
For faking data: https://github.com/marak/Faker.js/
JSON Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Account Data",
"description": "All information pertaining to a single account",
"type": "object",
"properties": {
"Username": {
"type": "string",
"faker": {
"fake": "{{internet.userName}}"
}
},
"Password": {
"type": "string",
"faker": {
"fake": "{{internet.password}}"
}
},
"Honorary": {
"type": "string",
"faker": {
"fake": "{{name.prefix}}"
}
},
"FirstName": {
"type": "string",
"faker": {
"fake": "{{name.firstName}}"
}
},
"LastName": {
"type": "string",
"faker": {
"fake": "{{name.lastName}}"
}
},
"MailingAddress": {
"type": "string",
"faker": {
"fake": "{{address.streetAddress}}"
}
},
"TelephoneAddress": {
"type": "integer",
"faker": {
"fake": "{{phone.phoneNumber}}",
"faker": "{{phone.phoneNumberFormat}}"
}
},
"EmailAddress": {
"type": "string"
},
"BankAccounts": [{
"SortCode": {
"type": "integer"
},
"AccountNumber": {
"type": "integer"
},
"Cards": {
"DebitCard": {
"NameOnCard": {
"type": "string"
},
"LongNumber": {
"type": "integer"
},
"StartDate": {
"type": "string"
},
"ExpiryDate": {
"type": "string"
},
"CardVerificationValue": {
"type": "string"
},
"Status": {
"type": "string"
}
},
"CreditCard": {
"NameOnCard": {
"type": "string"
},
"LongNumber": {
"type": "integer"
},
"ExpiryDate": {
"type": "string"
},
"CardVerificationValue": {
"type": "string"
},
"Status": {
"type": "string"
}
}
}
}]
},
"required": ["Username", "Password", "Honorary", "FirstName", "LastName", "MailingAddress", "TelephoneAddress", "EmailAddress", "BankAccounts"]
}
{
"Username":"",
"Password":"",
"Honorary":"",
"FirstName":"",
"LastName":"",
"MailingAddress":"",
"TelephoneAddress":"",
"EmailAddress":"",
"BankAccounts": [
{
"SortCode":"",
"AccountNumber":"",
"Cards": [
{
"Type": "Debit",
"NameOnCard": "",
"LongNumber": "",
"StartDate": "",
"ExpiryDate": "",
"CardVerificationValue": "",
"Status":""
},
{
"Type": "Credit",
"NameOnCard": "",
"LongNumber": "",
"ExpiryDate": "",
"CardVerificationValue": "",
"Status": ""
}
],
"Transfers": [
{
"TransferID": "",
"Type": "",
"FromAccountDetails": "",
"ToAccountDetails": "",
"AmountInGBP": "",
"AccountTotal": ""
}
],
"StandingOrders":[
{
"Reference": "",
"AccountNumber": "",
"SortCode": "",
"Amount": "",
"DateOfFirstPayment": "",
"DateOfLastPayment": "",
"Frequency": "",
"ContinueUntilCancelled": ""
}
],
"DirectDebits": ""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment