Amazon Ion Schema defines a grammar and constraints for narrowing the universe of Ion values. A schema consists of zero or more types, and a type is a collection of zero or more constraints over the Ion data model. Aspects of a value not constrained by a type (“open content”) are considered valid, which enables loosely-coupled systems to evolve independently.

Once defined, a type can be used to:

For more information, see the Ion Schema Specification.


Latest News


Ion Schema Kotlin (alpha) Open Sourced
05 November 2018

A reference implementation of Ion Schema is now available as open source software. It is written in Kotlin, and should be considered alpha software.

Ion Schema Reference Implementation

Ion Schema Specification 1.0 Released
29 October 2018

This new specification describes a language and set of constraints used to declaratively constrain Ion values.

Ion Schema Specification

Visit the News page for more announcements related to Ion Schema.


Ion Schema Example

type::{
  name: Person,
  type: struct,
  fields: {
    title: {
      type: symbol,
      valid_values: [Mr, Mrs, Miss, Ms, Mx, Dr],
    },
    firstName: { type: string, occurs: required },
    middleName: string,
    lastName: { type: string, occurs: required },
    age: { type: int, valid_values: range::[0, 130] },
  },
}

The following values are valid for the type Person:

{
  firstName: "Susan",
  lastName: "Jones",
}
{
  title: Mr,
  firstName: "Jonah",
  middleName: "Q.",
  lastName: "Smith",
  age: 34,
}

The following values are not valid for the type Person:

{
  firstName: "Cathy",        // lastName is required
}
{
  title: Prof,               // Prof is not a valid value for the title field
  firstName: "Jasmine",
  lastName: "Bradford",
}
{
  firstName: "Shami",
  lastName: "Ahmed",
  age: 131,                  // age must be between 0 and 130, inclusive
}