Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

141 lines (140 sloc) 5.179 kB
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "avro-schema",
"description": "JSON Schema for an Apache Avro schema, version 1.7.3",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"required": [ "type" ],
"properties": {
"type": { "$ref": "#/definitions/primitiveTypes" }
}
},
{ "$ref": "#/definitions/record" },
{ "$ref": "#/definitions/enum" },
{ "$ref": "#/definitions/array" },
{ "$ref": "#/definitions/map" },
{ "$ref": "#/definitions/union" },
{ "$ref": "#/definitions/fixed" }
],
"definitions": {
"primitiveTypes": {
"description": "One primitive type",
"enum": [ "null", "boolean", "int", "long", "float", "double", "bytes", "string" ]
},
"record": {
"description": "A record",
"type": "object",
"required": [ "type", "name", "fields" ],
"properties": {
"type": { "enum": [ "record" ] },
"name": { "$ref": "#/definitions/nameOrNamespace" },
"nameOrNamespace": { "$ref": "#/definitions/namespace" },
"doc": { "type": "string" },
"aliases": { "$ref": "#/definitions/aliases" },
"fields": {
"type": "array",
"items": { "$ref": "#/definitions/field" }
}
}
},
"enum": {
"description": "an enum as defined by the Avro specification",
"type": "object",
"required": [ "type", "name", "symbols" ],
"properties": {
"type": { "enum": [ "enum" ] },
"name": { "$ref": "#/definitions/nameOrNamespace" },
"nameOrNamespace": { "$ref": "#/definitions/namespace" },
"aliases": { "$ref": "#/definitions/aliases" },
"doc": { "type": "string" },
"symbols": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1,
"pattern": "^(?![_\\d])\\w+$"
},
"uniqueItems": true
}
}
},
"array": {
"description": "An array as defined by the Avro specification",
"notes": [ "spec doesn't say whether \"items\" is required!" ],
"type": "object",
"required": [ "type" ],
"properties": {
"type": { "enum": [ "array" ] },
"items": { "$ref": "#" }
}
},
"map": {
"description": "A map as defined by the Avro specification",
"notes": [ "spec doesn't say whether \"values\" is required!" ],
"type": "object",
"required": [ "type" ],
"properties": {
"type": { "enum": [ "map" ] },
"values": { "$ref": "#" }
}
},
"union": {
"description": "A union of schemas",
"type": "array",
"uniqueItems": true,
"items": {
"allOf": [
{ "$ref": "#" },
{ "not": { "$ref": "#/definitions/union" } }
]
}
},
"fixed": {
"description": "A fixed type, as defined by the Avro specification",
"type": "object",
"required": [ "type", "name", "size" ],
"properties": {
"type": { "enum": [ "fixed" ] },
"name": { "$ref": "#/definitions/nameOrNamespace" },
"nameOrNamespace": { "$ref": "#/definitions/namespace" },
"size": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"aliases": { "$ref": "#/definitions/aliases" }
}
},
"nameOrNamespace": {
"description": "what a nameOrNamespace can be",
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$"
},
"aliases": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {"$ref": "#/definitions/nameOrNamespace" }
},
"field": {
"description": "One field in a record",
"type": "object",
"required": [ "name", "type" ],
"properties": {
"name": { "$ref": "#/definitions/nameOrNamespace" },
"doc": { "type": "string" },
"type": { "$ref": "#" },
"default": {
"description": "default value, depending on the type"
},
"order": {
"enum": [ "ascending", "descending", "ignore" ]
},
"aliases": { "$ref": "#/definitions/aliases" }
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.