Created
June 28, 2011 16:11
-
-
Save trans/1051496 to your computer and use it in GitHub Desktop.
Possible Formats for .yes document using invoice.yml example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
/: | |
tag: <tag:clarkevans.com,2002:invoice> | |
invoice: &mandatoryint | |
type: int | |
required: true | |
date: | |
type: date | |
required: true | |
bill-to: &billing-schema-alias | |
type: map | |
required: true | |
bill-to/given: &amms # Short for "All Mandatory Strings Schema" | |
type: str | |
required: true | |
bill-to/family: *amms | |
bill-to/address: | |
type: map | |
required: true | |
bill-to/address/lines: *amms | |
bill-to/address/city: *amms # Or suburb. | |
bill-to/address/state: &aoss # Short for "All Optional Strings Schema" | |
type: string | |
required: false # Not every country has states or provinces. | |
bill-to/address/country: &aoss # Unnecessary if posting in the same country. | |
bill-to/address/postal: &aoss # Some countries don't use postcodes. | |
ship-to: *billing-schema-alias # Yay for anchors and aliases! | |
tax: ¤cy # Should indicate two decimal places - no more, no less. | |
type: float | |
required: true | |
total: *currency | |
comments: *amms | |
product: | |
type: seqorsing: # See below | |
required: true | |
product/sku: *amms | |
product/quantity: *mandatoryint | |
product/description: *amms | |
product/price: *currency | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
/: | |
tag: <tag:clarkevans.com,2002:invoice> | |
value: | |
invoice: &mandatoryint | |
type: int | |
required: true #Shouldn't we use booleans like true and false? | |
date: | |
type: datetime #Indicate somehow that dates are required, buttimes are not? | |
required: true | |
bill-to: &billing-schema-alias | |
type: map | |
required: true | |
value: # We could refer to this by Ypaths, but it feels more natural to embed in it the parent structure schema | |
given: &amms # Short for "All Mandatory Strings Schema" | |
type: str | |
required: true | |
family: *amms | |
address: | |
type: map | |
required: true | |
value: | |
lines: *amms | |
city: *amms # Or suburb. | |
state: &aoss # Short for "All Optional Strings Schema" | |
type: string | |
required: false # Not every country has states or provinces. | |
country: &aoss # Unnecessary if posting in the same country. | |
postal: &aoss # Some countries don't use postcodes. | |
ship-to: *billing-schema-alias # Yay for anchors and aliases! | |
tax: ¤cy # Should indicate two decimal places - no more, no less. | |
type: float | |
required: true | |
total: *currency | |
comments: *amms | |
product: | |
type: seqorsing: # See below | |
required: true | |
value: | |
sku: *amms | |
quantity: *mandatoryint | |
description: *amms | |
price: *currency | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
/: | |
@tag: <tag:clarkevans.com,2002:invoice> | |
invoice: &mandatoryint | |
@type: int | |
@required: true #Shouldn't we use booleans like true and false? | |
date: | |
@type: datetime #Indicate somehow that dates are required, buttimes are not? | |
@required: true | |
bill-to: &billing-schema-alias | |
@type: map | |
@required: true | |
given: &amms # Short for "All Mandatory Strings Schema" | |
@type: str | |
@required: true | |
family: *amms | |
address: | |
@type: map | |
@required: true | |
lines: *amms | |
city: *amms # Or suburb. | |
state: &aoss # Short for "All Optional Strings Schema" | |
@type: string | |
@required: false # Not every country has states or provinces. | |
country: &aoss # Unnecessary if posting in the same country. | |
postal: &aoss # Some countries don't use postcodes. | |
ship-to: *billing-schema-alias # Yay for anchors and aliases! | |
tax: ¤cy # Should indicate two decimal places - no more, no less. | |
@type: float | |
@required: true | |
total: *currency | |
comments: *amms | |
product: | |
@type: seqorsing: # See below | |
@required: true | |
sku: *amms | |
quantity: *mandatoryint | |
description: *amms | |
price: *currency | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment