Added:
wiki/RestrictionTypes.wiki
Log:
Created wiki page through web user interface.
Added: wiki/RestrictionTypes.wiki
==============================================================================
--- (empty file)
+++ wiki/RestrictionTypes.wiki Wed Feb 27 21:43:05 2008
@@ -0,0 +1,14 @@
+#summary Restriction types, types based on limiting acceptable values.
+
+= Introduction =
+
+In addition to the [CoreTypes core types], it is possible to create
your own types by restricting the other types to meet your specific
requirements. While the core types are very broad, through restrictions
you can indicate required and optional fields on an object, the data
values of an array, or the format of a particular piece of data.
+
+Note that a type cannot be extended, or made to accept more values,
via restriction types. It is recommended for these cases that
[UnionTypes union types] be used instead.
+
+= Details =
+
+Restriction types are represented by a JSON object, and have three
general categories of data members:
+ * *basis* - types are meant to form a hierarchy, with are declared
based on some preexisting type, by [TypeName type name]. Restriction
types are always considered to inheirit the restrictions of their
parent types; if a type is considered valid, all restriction types
which are the basis of that type (up the tree) also must be valid. For
restriction types, there must be one type as a basis - although it can
be a union type like `any`.
+ * *[Restrictions restrictions]* - a restriction type is, at its
heart, a set of restrictions to enforce on data. Restrictions generally
are meant to apply to a single core type, and do not have overloaded
meanings which apply to multiple core types. This is done to simplify
putting restrictions on a union type.
+ * *[Metadata metadata]* - Schemas exist not just for validation but
also for documentation and communication. It is important that schemas
be easy to annotate with additional information.
\ No newline at end of file