Skip to content

Explain complex attributes, again #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add example for complex attributes
  • Loading branch information
bintoro committed Mar 25, 2015
commit 0d85ddcb5c10c97fe66bfca860ce9301f03af406
42 changes: 42 additions & 0 deletions examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,45 @@ title: Examples

This page contains additional examples of how to apply various parts of the specification.

### Complex Attributes <a href="#complex-attributes" id="complex-attributes" class="headerlink"></a>

The following resource object represents an invoice and contains three [complex
attributes](/format/#document-structure-resource-object-complex-attributes):
`notes`, `total`, and `customer-references`.

```json
{
"type": "invoices",
"id": "1234",
"date": "2015-02-14",
"due": "2015-03-14",
"notes": ["Lorem ipsum dolor sit amet", "Consectetuer adipiscing elit"],
"total": {
"currency": "EUR",
"line-items": 3000.00,
"discounts": 150.00,
"tax": {
"tax-type": "VAT",
"taxable-amount": 2850.00,
"tax-amount": 570.00
},
"amount-payable": 3420.00
},
"customer-references": [{
"ref-type": "purchase-order",
"text": "AB3210"
}, {
"ref-type": "other",
"text": "Department XYZ"
}],
"links": {
"customer": {
"related": "http://example.com/invoices/1234/customer"
},
"line-items": {
"related": "http://example.com/invoices/1234/line-items"
}
}
}
```

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy