Ion (serialization format)
Appearance
The topic of this article may not meet Wikipedia's general notability guideline. (July 2017) |
Filename extension |
.ion |
---|---|
Internet media type | application/ion |
Developed by | Amazon |
Type of format | Data interchange |
Website | amznlabs |
Ion is a data serialization language developed by Amazon. It may be represented by either a human-readable text form or a compact binary form. The text form is a superset of JSON; thus, any valid JSON document is also a valid Ion document.
Data types
As a superset of JSON, Ion includes the following data types
null
: An empty valuebool
: Boolean valuesstring
: Unicode text literalslist
: Ordered heterogeneous collection of Ion valuesstruct
: Unordered collection of key/value pairs
The nebulous JSON 'number' type is strictly defined in Ion to be one of
int
: Signed integers of arbitrary sizefloat
: 64-bit IEEE binary-encoded floating point numbersdecimal
: Decimal-encoded real numbers of arbitrary precision
Ion adds these types:
timestamp
: Date/time/timezone moments of arbitrary precisionsymbol
: Unicode symbolic atoms (aka identifiers)blob
: Binary data of user-defined encodingclob
: Text data of user-defined encodingsexp
: Ordered collections of values with application-defined semantics
Each Ion type supports a null variant, indicating a lack of value while maintaining a strict type (e.g., null.int
, null.struct
).
The Ion format permits annotations to any value in the form of symbols. Such annotations may be used as metadata for otherwise opaque data (such as a blob).
Examples
Sample document
{
"key": "value",
"A float value": -31415e-4,
"An int value": null.int
}
External links