Skip to content

Instantly share code, notes, and snippets.

@LizAinslie
Created January 10, 2020 19:00
Show Gist options
  • Save LizAinslie/6005aebde01cf4e99da9035f6fd4b06e to your computer and use it in GitHub Desktop.
Save LizAinslie/6005aebde01cf4e99da9035f6fd4b06e to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"textures": {
"type": "object",
"patternProperties": {
"(\\w+)": {
"$ref": "#/definitions/texture"
}
}
},
"elements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rotations": {
"type": "object",
"properties": {
"x": { "$ref": "#/definitions/rotation" },
"y": { "$ref": "#/definitions/rotation" },
"z": { "$ref": "#/definitions/rotation" }
}
},
"from": {
"$ref": "#/definitions/array_vector3"
},
"to": {
"$ref": "#/definitions/array_vector3"
},
"faces": {
"type": "object",
"properties": {
"north": {
"$ref": "#/definitions/face"
},
"south": {
"$ref": "#/definitions/face"
},
"east": {
"$ref": "#/definitions/face"
},
"west": {
"$ref": "#/definitions/face"
},
"down": {
"$ref": "#/definitions/face"
},
"up": {
"$ref": "#/definitions/face"
}
}
}
}
}
}
},
"definitions": {
"rotation": {
"enum": [-45, -22.5, 0, 22.5, 45]
},
"array_vector3": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"array_vector4": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 4,
"minItems": 4
},
"face": {
"type": "object",
"properties": {
"uv": {
"$ref": "#/definitions/array_vector4"
},
"uvRotation": {
"$ref": "#/definitions/rotation"
},
"texture": {
"oneOf": [
{
"$ref": "#/definitions/texture"
},
{
"type": "string",
"pattern": "(#\\w+)"
}
]
}
}
},
"texture": {
"type": "string",
"pattern": "(\\w+\\:)?\\w+\\/\\w+"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment