-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
basket: | ||
- product: bananas | ||
price: 0.39 | ||
per: pound | ||
weight: 1 | ||
- product: cucumbers | ||
price: 0.79 | ||
per: item | ||
count: 3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
- name: Product | ||
doc: | | ||
The base type for a product. This is an abstract type, so it | ||
can't be used directly, but can be used to define other types. | ||
type: record | ||
abstract: true | ||
fields: | ||
product: string | ||
price: float | ||
|
||
- name: ByWeight | ||
doc: | | ||
A product, sold by weight. Products may be sold by pound or by | ||
kilogram. Weights may be fractional. | ||
type: record | ||
extends: Product | ||
fields: | ||
per: | ||
type: | ||
type: enum | ||
symbols: | ||
- pound | ||
- kilogram | ||
jsonldPredicate: "#per" | ||
weight: float | ||
|
||
- name: ByCount | ||
doc: | | ||
A product, sold by count. The count must be a integer value. | ||
type: record | ||
extends: Product | ||
fields: | ||
per: | ||
type: | ||
type: enum | ||
symbols: | ||
- item | ||
jsonldPredicate: "#per" | ||
count: int | ||
|
||
- name: Basket | ||
doc: | | ||
A basket of products. The 'documentRoot' field indicates it is a | ||
valid starting point for a document. The 'basket' field will | ||
validate subtypes of 'Product' (ByWeight and ByCount). | ||
type: record | ||
documentRoot: true | ||
fields: | ||
basket: | ||
type: | ||
type: array | ||
items: Product |