LogoLogo
  • Internet Object 1.0
  • Internet Object
    • Abstract
    • The Poetic Principles of Internet Object
    • Objectives
    • Introducing Internet Object
  • The Structure
    • Internet Object Document
      • Header
      • Data Sections
    • Structural Elements
      • Structural Characters and Literals
      • Literals
      • Other Special Characters
      • Whitespaces
    • Values Representations
      • Objects
      • Arrays
      • Strings
        • Open Strings
        • Regular Strings
        • Raw Strings
      • Numeric Values
        • Number
        • BigInt
        • Decimal
        • Special Numeric Integer Formats
          • Hexadecimal
          • Octal
          • Binary
        • NaN and Infinity
      • Binary
      • Date and Time
      • Booleans
      • Nulls
    • Comments
    • Encoding
  • The Collections
    • Collection
    • Creating Collection
    • Collection Rules
    • Data Streaming
  • The Definitions
    • Definitions
    • Variables
    • Complex Schema
  • Schema Definition Language
    • Internet Object Schema
    • The structure
    • Data Types
      • Any
      • String
        • String Derived Types
          • Email
          • URL
          • Date
          • Time
          • DateTime
      • Number
        • Derived Types
          • int
          • byte
          • int16
          • int32
      • Object
      • Array
      • Bool
    • Dynamic Schema
    • Is Object, a MemberDef or a Schema?
  • Other
    • Best Practices
    • FAQs
    • Contributors
    • License
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Schema Definition Language

Internet Object Schema

PreviousComplex SchemaNextThe structure

Last updated 3 years ago

Was this helpful?

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!

The schema structure (whitespaces are not shown)

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 ",".

#Schema with the valid representation
name, age, address, isActive, remark 

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.

# Schema with the valid representation
name, age, address, isActive, remark 
---
John Doe, 20, {Bond Street, New York}, T, Nothing

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.

# Schema with the members associated with types
name: string,
age: int, 
address: {
  street: string, 
  city: string, 
  state: string
}, 
isActive: bool, 
remark: string

Here name, age, address, isActive, and remark are defined with the type string, int, object, bool and string respectively.