Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Developers are not required to use sub-properties. In the above example, each of the sub-properties could have been regular properties in the resource object. However, let's suppose there are different types of addresses in the resource object. We'll use mailing and shipping. If both types of addresses were represented by regular properties then the resource object might look like this:

Code Block
languagejs
{
   "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"
}


No Format
{
   "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"
}

...