Internet Object Schema
Internet Object is a schema first format! The Internet Object schema defines the shape and structure of Internet Object documents and helps the developers and designers to create the object definitions in a simple, concise, clear, and human-readable way.
The schema asserts the shape of the IO objects and ensures the validity of the data during the serialization and deserialization process.
The schema may be attached and placed in the document header or kept separately. Internet Object schema provides a simple way to define the object structure!
In its simplest form, an object schema is just an object with a list of required members. The following example represents the schema with five keys i.e name
, age
, address
, isActive
, remark
which are separated by ","
.
A schema can be embedded in the IO document header or defined independently. The following example shows the schema embedded into the document itself. The upper section declares the schema while the lower section contains the object.
The schema in the previous example lacks the datatypes. Since the keys are not associated any data type, the default datatype is any
. That means the value for the name
field could be John Doe
, T
or 999
or anything.
We can attach types and sub-schema to the keys to add more constraints and clarity.
Here name
, age
, address
, isActive
, and remark
are defined with the type string
, int
, object
, bool
and string
respectively.
Last updated