{
	"$schema" : "http://json-schema.org/draft-04/schema#",
	"definitions" : {
		"one" : {
			"HasAny" : {
				"type" : "object",
				"subType" : "record",
				"properties" : {
					"num" : {
						"type" : "integer"
					},
					"at" : {
						"$ref" : "#/definitions/one/anytype"
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"num",
					"at"
				],
				"required" : [
					"num",
					"at"
				]
			},
			"Height" : {
				"enum" : [
					"Short",
					"Medium",
					"Tall"
				],
				"numericValues" : [
					0,
					1,
					2
				]
			},
			"Rec" : {
				"type" : "object",
				"subType" : "record",
				"properties" : {
					"num" : {
						"type" : "integer",
						"default" : 0
					},
					"str" : {
						"type" : "string",
						"subType" : "universal charstring",
						"default" : "empty"
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"num",
					"str"
				],
				"required" : [
					"num",
					"str"
				],
				"comment" : "abc"
			},
			"Set" : {
				"type" : "object",
				"subType" : "set",
				"properties" : {
					"os" : {
						"type" : "string",
						"subType" : "octetstring",
						"pattern" : "^([0-9A-Fa-f][0-9A-Fa-f])*$",
						"MSB" : "first"
					},
					"buul" : {
						"anyOf" : [
							{
								"type" : "null"
							},
							{
								"type" : "boolean"
							}
						],
						"omitAsNull" : true
					},
					"verd" : {
						"anyOf" : [
							{
								"type" : "null"
							},
							{
								"enum" : [
									"none",
									"pass",
									"inconc",
									"fail",
									"error"
								]
							}
						],
						"omitAsNull" : false
					},
					"numbr" : {
						"anyOf" : [
							{
								"type" : "number"
							},
							{
								"enum" : [
									"not_a_number",
									"infinity",
									"-infinity"
								]
							}
						],
						"default" : "-infinity"
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"os",
					"buul",
					"verd",
					"numbr"
				],
				"required" : [
					"os",
					"numbr"
				]
			},
			"Uni" : {
				"anyOf" : [
					{
						"type" : "object",
						"properties" : {
							"numbr" : {
								"anyOf" : [
									{
										"type" : "number"
									},
									{
										"enum" : [
											"not_a_number",
											"infinity",
											"-infinity"
										]
									}
								]
							}
						},
						"additionalProperties" : false,
						"required" : [
							"numbr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"bytes" : {
								"type" : "string",
								"subType" : "octetstring",
								"pattern" : "^([0-9A-Fa-f][0-9A-Fa-f])*$"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"bytes"
						]
					}
				],
				"defaultSelection" : "numbr"
			},
			"Width" : {
				"enum" : [
					"Thin",
					"Medium",
					"Wide"
				],
				"numericValues" : [
					0,
					1,
					2
				]
			},
			"anytype" : {
				"anyOf" : [
					{
						"type" : "object",
						"properties" : {
							"integer" : {
								"type" : "integer"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"integer"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"boolean" : {
								"type" : "boolean"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"boolean"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"bitstring" : {
								"type" : "string",
								"subType" : "bitstring",
								"pattern" : "^[01]*$"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"bitstring"
						]
					}
				]
			}
		},
		"two" : {
			"Ints" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"type" : "integer"
				}
			},
			"Intses" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"$ref" : "#/definitions/two/Ints"
				},
				"alias" : "RoRoI"
			},
			"Octets" : {
				"type" : "array",
				"subType" : "set of",
				"items" : {
					"type" : "string",
					"subType" : "octetstring",
					"pattern" : "^([0-9A-Fa-f][0-9A-Fa-f])*$"
				},
				"comment" : "set of octetstrings"
			},
			"PosInt" : {
				"type" : "integer",
				"minimum" : 0,
				"exclusiveMinimum" : false
			}
		},
		"three" : {
			"Barrels" : {
				"type" : "object",
				"subType" : "set",
				"properties" : {
					"numBarrels" : {
						"type" : "integer"
					},
					"barrelType" : {
						"type" : "object",
						"subType" : "record",
						"properties" : {
							"size" : {
								"enum" : [
									"Small",
									"Medium",
									"Large"
								],
								"numericValues" : [
									0,
									1,
									2
								]
							},
							"filled" : {
								"type" : "boolean"
							}
						},
						"additionalProperties" : false,
						"fieldOrder" : [
							"size",
							"filled"
						],
						"required" : [
							"size",
							"filled"
						],
						"comment" : "first comment",
						"comment" : "second comment"
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"numBarrels",
					"barrelType"
				],
				"required" : [
					"numBarrels",
					"barrelType"
				]
			},
			"Nums" : {
				"type" : "array",
				"subType" : "set of",
				"items" : {
					"type" : "object",
					"subType" : "record",
					"properties" : {
						"number" : {
							"originalName" : "num",
							"type" : "integer"
						}
					},
					"additionalProperties" : false,
					"required" : [
						"number"
					]
				}
			},
			"Numz" : {
				"type" : "object",
				"subType" : "record",
				"properties" : {
					"nums" : {
						"$ref" : "#/definitions/three/Nums"
					}
				},
				"additionalProperties" : false,
				"required" : [
					"nums"
				]
			},
			"Rex" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"$ref" : "#/definitions/one/Rec"
				}
			},
			"Stuff" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"$ref" : "#/definitions/three/Thing"
				}
			},
			"Thing" : {
				"anyOf" : [
					{
						"originalName" : "b",
						"type" : "boolean"
					},
					{
						"originalName" : "i",
						"unusedAlias" : "int",
						"type" : "integer"
					},
					{
						"originalName" : "cs",
						"unusedAlias" : "str",
						"type" : "string",
						"subType" : "charstring"
					},
					{
						"originalName" : "rec",
						"type" : "object",
						"subType" : "record",
						"properties" : {
							"num" : {
								"type" : "integer"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"num"
						]
					}
				]
			}
		},
		"Zero" : {
			"AnyString" : {
				"anyOf" : [
					{
						"type" : "object",
						"properties" : {
							"generalstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"generalstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"numericstr" : {
								"type" : "string",
								"subType" : "charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"numericstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"utf8str" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"utf8str"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"printablestr" : {
								"type" : "string",
								"subType" : "charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"printablestr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"universalstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"universalstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"bmpstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"bmpstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"graphicstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"graphicstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"ia5str" : {
								"type" : "string",
								"subType" : "charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"ia5str"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"teletexstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"teletexstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"videotexstr" : {
								"type" : "string",
								"subType" : "universal charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"videotexstr"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"visiblestr" : {
								"type" : "string",
								"subType" : "charstring"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"visiblestr"
						]
					}
				]
			},
			"Big_Choice" : {
				"anyOf" : [
					{
						"type" : "object",
						"properties" : {
							"numbers" : {
								"type" : "array",
								"subType" : "set of",
								"items" : {
									"$ref" : "#/definitions/Zero/Number"
								}
							}
						},
						"additionalProperties" : false,
						"required" : [
							"numbers"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"strings" : {
								"$ref" : "#/definitions/Zero/ManyStrings"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"strings"
						]
					}
				]
			},
			"Big_Set" : {
				"type" : "object",
				"subType" : "set",
				"properties" : {
					"product" : {
						"$ref" : "#/definitions/Zero/SeqProduct"
					},
					"numbers" : {
						"type" : "array",
						"subType" : "set of",
						"items" : {
							"$ref" : "#/definitions/Zero/Number"
						}
					},
					"strings" : {
						"$ref" : "#/definitions/Zero/ManyStrings"
					},
					"color" : {
						"enum" : [
							"red",
							"blue",
							"green",
							"yellow"
						],
						"numericValues" : [
							0,
							1,
							2,
							3
						]
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"product",
					"numbers",
					"strings",
					"color"
				],
				"required" : [
					"product",
					"numbers",
					"strings",
					"color"
				]
			},
			"ManyStrings" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"$ref" : "#/definitions/Zero/AnyString"
				}
			},
			"NullType" : {
				"type" : "null"
			},
			"Number" : {
				"anyOf" : [
					{
						"type" : "object",
						"properties" : {
							"decimal" : {
								"type" : "integer"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"decimal"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"binary" : {
								"type" : "string",
								"subType" : "bitstring",
								"pattern" : "^[01]*$"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"binary"
						]
					},
					{
						"type" : "object",
						"properties" : {
							"hexadecimal" : {
								"type" : "string",
								"subType" : "octetstring",
								"pattern" : "^([0-9A-Fa-f][0-9A-Fa-f])*$"
							}
						},
						"additionalProperties" : false,
						"required" : [
							"hexadecimal"
						]
					}
				]
			},
			"ObjIdType" : {
				"type" : "string",
				"subType" : "objid",
				"pattern" : "^[0-2][.][1-3]?[0-9]([.][0-9]|([1-9][0-9]+))*$"
			},
			"RelObjIdType" : {
				"type" : "string",
				"subType" : "objid",
				"pattern" : "^[0-2][.][1-3]?[0-9]([.][0-9]|([1-9][0-9]+))*$"
			},
			"Season" : {
				"enum" : [
					"spring",
					"summer",
					"fall",
					"winter"
				],
				"numericValues" : [
					1,
					2,
					3,
					4
				]
			},
			"SelectionType" : {
				"type" : "array",
				"subType" : "set of",
				"items" : {
					"$ref" : "#/definitions/Zero/Number"
				}
			},
			"SeqOfInt" : {
				"type" : "array",
				"subType" : "record of",
				"items" : {
					"type" : "integer"
				}
			},
			"SeqProduct" : {
				"type" : "object",
				"subType" : "record",
				"properties" : {
					"name" : {
						"type" : "string",
						"subType" : "universal charstring"
					},
					"price" : {
						"anyOf" : [
							{
								"type" : "number"
							},
							{
								"enum" : [
									"not_a_number",
									"infinity",
									"-infinity"
								]
							}
						]
					},
					"id" : {
						"anyOf" : [
							{
								"type" : "null"
							},
							{
								"type" : "string",
								"subType" : "octetstring",
								"pattern" : "^([0-9A-Fa-f][0-9A-Fa-f])*$"
							}
						],
						"omitAsNull" : false
					},
					"available" : {
						"type" : "boolean"
					}
				},
				"additionalProperties" : false,
				"fieldOrder" : [
					"name",
					"price",
					"id",
					"available"
				],
				"required" : [
					"name",
					"price",
					"available"
				]
			}
		}
	},
	"anyOf" : [
		{
			"$ref" : "#/definitions/two/Intses"
		},
		{
			"$ref" : "#/definitions/one/Rec",
			"decoding" : {
				"prototype" : [
					"convert",
					"f_dec_rec",
					"octie"
				],
				"errorBehavior" : {
					"ALL" : "WARNING",
					"INVAL_MSG" : "ERROR"
				}
			},
			"encoding" : {
				"prototype" : [
					"convert",
					"f_enc_rec",
					"x"
				]
			}
		},
		{
			"$ref" : "#/definitions/two/Ints",
			"decoding" : {
				"prototype" : [
					"fast",
					"f_dec_ints",
					"os",
					"x"
				]
			},
			"encoding" : {
				"prototype" : [
					"fast",
					"f_enc_ints",
					"eents",
					"octus"
				],
				"printing" : "pretty"
			}
		},
		{
			"$ref" : "#/definitions/one/Set"
		},
		{
			"$ref" : "#/definitions/one/Uni"
		},
		{
			"$ref" : "#/definitions/one/HasAny"
		},
		{
			"$ref" : "#/definitions/one/Height"
		},
		{
			"$ref" : "#/definitions/one/Width"
		},
		{
			"$ref" : "#/definitions/one/anytype"
		},
		{
			"$ref" : "#/definitions/three/Thing"
		},
		{
			"$ref" : "#/definitions/three/Stuff"
		},
		{
			"$ref" : "#/definitions/three/Barrels"
		},
		{
			"$ref" : "#/definitions/two/Octets"
		},
		{
			"$ref" : "#/definitions/two/PosInt"
		},
		{
			"$ref" : "#/definitions/Zero/SeqOfInt"
		},
		{
			"$ref" : "#/definitions/Zero/SeqProduct"
		},
		{
			"$ref" : "#/definitions/Zero/Number"
		},
		{
			"$ref" : "#/definitions/three/Nums"
		},
		{
			"$ref" : "#/definitions/three/Numz"
		},
		{
			"$ref" : "#/definitions/three/Rex"
		},
		{
			"$ref" : "#/definitions/Zero/AnyString"
		},
		{
			"$ref" : "#/definitions/Zero/ManyStrings"
		},
		{
			"$ref" : "#/definitions/Zero/Big_Set",
			"decoding" : {
				"prototype" : [
					"convert",
					"f_dec_bigset",
					"os"
				]
			},
			"encoding" : {
				"prototype" : [
					"convert",
					"f_enc_bigset",
					"x"
				]
			}
		},
		{
			"$ref" : "#/definitions/Zero/Big_Choice"
		},
		{
			"$ref" : "#/definitions/Zero/Season"
		},
		{
			"$ref" : "#/definitions/Zero/SelectionType"
		},
		{
			"$ref" : "#/definitions/Zero/NullType"
		},
		{
			"$ref" : "#/definitions/Zero/ObjIdType"
		},
		{
			"$ref" : "#/definitions/Zero/RelObjIdType"
		}
	]
}
