Page History
...
Sub-Properties are used when a regular property is a composite of other identifying properties. An example works well to illustrate:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "shipping":{ "address":"6649 N Blue Gum St", "city":"New Orleans", "county":"Orleans", "state":"LA", "zip":"70116" } } |
...
Code Block | ||
---|---|---|
| ||
{ "mailingAddress":"PO Box 1234", "mailingCity":"New Orleans", "mailingCounty":"Orleans", "mailingState":"LA", "mailingZip":"70116", "shippingAddress":"6649 N Blue Gum St", "shippingCity":"New Orleans", "shippingCounty":"Orleans", "shippingState":"LA", "shippingZip":"70116" } | ||
{
"mailingAddress":"PO Box 1234",
"mailingCity":"New Orleans",
"mailingCounty":"Orleans",
"mailingState":"LA",
"mailingZip":"70116",
"shippingAddress":"6649 N Blue Gum St",
"shippingCity":"New Orleans",
"shippingCounty":"Orleans",
"shippingState":"LA",
"shippingZip":"70116"
} |
This isn't horrible, but we might consider that sub-properties help to make this look better and help it to be better organized:as a way to help improve the presentation and organization of the data:
Code Block | ||
---|---|---|
| ||
{ "mailing":{ "Addressaddress":"PO Box 1234", "Citycity":"New Orleans", "Countycounty":"Orleans", "Statestate":"LA", "Zipzip":"70116" }, "shipping":{ "Addressaddress":"6649 N Blue Gum St", "Citycity":"New Orleans", "Countycounty":"Orleans", "Statestate":"LA", "Zipzip":"70116" } } |
...