18.01.2015 Views

Content Management Interoperability Services (CMIS) Version 1.1

Content Management Interoperability Services (CMIS) Version 1.1

Content Management Interoperability Services (CMIS) Version 1.1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

B.3 A Non-Normative Tutorial<br />

A collection of Non-normative examples of Orderly:<br />

B.3.1<br />

Comments and Whitespace<br />

Orderly supports comments, comments are initiated with either '#' or '//' and continue to the first encountered<br />

newline ('\n').<br />

Orderly doesn't rely overmuch on whitespace, leaving the decision of how to format your schema up to you.<br />

B.3.2<br />

Property Names<br />

Property names may be anything that is allowed inside JSON strings. Unlike JSON itself, however, Orderly<br />

provides a shorthand that allows a subset of strings to be represented without quotes.<br />

For instance these are all valid Orderly:<br />

string foo;<br />

string "foo";<br />

string "this is a property name with spaces";<br />

B.3.3<br />

Common Properties<br />

From the JSONSchema specification, four options exist which apply to all data types:<br />

The optional property indicates a value which is not required in a conformant JSON instance. Optional<br />

values are represented in Orderly with a trailing question mark:<br />

string name;<br />

string "name";<br />

The requires property says that if a value is present in the instance JSON, another named value MUST also<br />

be present. In Orderly a requirement on another type is expressed by placing the property name (optionally<br />

quoted) enclosed in angle brackets at the end of a type definition:<br />

string town ;<br />

Multiple properties MAY be required, and SHOULD be separated with commas:<br />

string town ;<br />

The enum property specifies a set of allowable values for a key in the JSON document.<br />

string mood [ "happy", "sad", "meh" ];<br />

integer secretOfLife [ 7, 42 ];<br />

In a JSONSchema document the default property specifies a default value for a property. One could imagine<br />

that as an input object passes validation it will be automatically augmented with default values for required<br />

properties missing in the instance object. The specification of default values in Orderly looks something like<br />

assignment in most programming languages:<br />

string mood [ "happy", "sad", "meh" ] = "happy"; # optimistically default to "happy"<br />

<strong>CMIS</strong>-v<strong>1.1</strong>-csprd01<br />

Standards Track Work Product<br />

Copyright © OASIS Open 2012. All Rights Reserved.<br />

18 August 2012<br />

Page 319 of 331

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!