EGI-FCTF/rOCCI-core

View on GitHub
lib/occi/core/parsers/json/validator/occi-schema.json

Summary

Maintainability
Test Coverage
{
    "id": "occi-schema.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "OCCI v1.2 JSON Rendering Schema",
    "definitions": {
        "kinded_uri": {
            "id": "#kinded_uri",
            "type": "object",
            "required": ["location"],
            "additionalProperties": false,
            "properties": {
                "location": { "type": "string" },
                "kind": { "type": "string" }
            }
        },
        "attributes": {
            "id": "#attributes",
            "type": "object",
            "additionalProperties": {
                "oneOf": [
                    { "type": "number" },
                    { "type": "boolean" },
                    { "type": "string" },
                    { "type": "object" },
                    { "type": "array" }
                ]
            }
        },
        "attribute_definition": {
            "id": "#attribute_definition",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "mutable", "required"],
            "properties": {
                "mutable": { "type": "boolean" },
                "required": { "type": "boolean" },
                "type": { "type": "string" },
                "default": {
                    "oneOf": [
                        { "type": "number" },
                        { "type": "string" },
                        { "type": "boolean" },
                        { "type": "object" },
                        { "type": "array" }
                    ]
                },
                "description": { "type": "string" },
                "pattern": { "type": "string" }
            }
        },
        "attribute_definitions": {
            "id": "#attribute_definitions",
            "type": "object",
            "additionalProperties": false,
            "patternProperties": {
                ".+": {
                    "$ref": "#/definitions/attribute_definition"
                }
            }
        },
        "kind": {
            "id": "#kind",
            "type": "object",
            "required": ["term", "scheme", "location"],
            "additionalProperties": false,
            "properties": {
                "term": { "type": "string" },
                "scheme": { "type": "string" },
                "title": { "type": "string" },
                "attributes": { "$ref": "#/definitions/attribute_definitions" },
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "parent": { "type": "string" },
                "location": { "type": "string" }
            }
        },
        "mixin": {
            "id": "#mixin",
            "type": "object",
            "required": ["term", "scheme", "location"],
            "additionalProperties": false,
            "properties": {
                "term": { "type": "string" },
                "scheme": { "type": "string" },
                "title": { "type": "string" },
                "attributes": { "$ref": "#/definitions/attribute_definitions" },
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "depends": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "applies": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "location": { "type": "string" }
            }
        },
        "action": {
            "id": "#action",
            "type": "object",
            "required": ["term", "scheme"],
            "additionalProperties": false,
            "properties": {
                "term": { "type": "string" },
                "scheme": { "type": "string" },
                "title": { "type": "string" },
                "attributes": { "$ref": "#/definitions/attribute_definitions" }
            }
        },
        "action_instance": {
            "id": "#action_instance",
            "type": "object",
            "required": ["action"],
            "additionalProperties": false,
            "properties": {
                "action": { "type": "string" },
                "attributes": { "$ref": "#/definitions/attributes" }
            }
        },
        "resource": {
            "id": "#resource",
            "type": "object",
            "required": ["kind", "id", "attributes"],
            "additionalProperties": false,
            "properties": {
                "kind": { "type": "string" },
                "mixins": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "attributes": { "$ref": "#/definitions/attributes" },
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "id": { "type": "string" },
                "links": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/link"
                    }
                },
                "summary": { "type": "string" },
                "title": { "type": "string" }
            }
        },
        "link": {
            "id": "#link",
            "type": "object",
            "required": ["kind", "id", "target", "source", "attributes"],
            "additionalProperties": false,
            "properties": {
                "kind": { "type": "string" },
                "mixins": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "attributes": { "$ref": "#/definitions/attributes" },
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "id": { "type": "string" },
                "source": { "$ref": "#/definitions/kinded_uri" },
                "target": { "$ref": "#/definitions/kinded_uri" },
                "title": { "type": "string" }
            }
        },
        "resource_collection": {
            "id": "#resource_collection",
            "type": "object",
            "required": ["resources"],
            "additionalProperties": false,
            "properties": {
                "resources": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/resource"
                    }
                }
            }
        },
        "link_collection": {
            "id": "#link_collection",
            "type": "object",
            "required": ["links"],
            "additionalProperties": false,
            "properties": {
                "links": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/link"
                    }
                }
            }
        },
        "entity_collection": {
            "id": "#entity_collection",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "resources": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/resource"
                    }
                },
                "links": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/link"
                    }
                }
            }
        },
        "mixin_identifiers": {
            "id": "#mixin_identifiers",
            "type": "object",
            "required": ["mixins"],
            "additionalProperties": false,
            "properties": {
                "mixins": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }
            }
        },
        "kind_identifiers": {
            "id": "#kind_identifiers",
            "type": "object",
            "required": ["kinds"],
            "additionalProperties": false,
            "properties": {
                "kinds": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }
            }
        },
        "action_identifiers": {
            "id": "#action_identifiers",
            "type": "object",
            "required": ["actions"],
            "additionalProperties": false,
            "properties": {
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }
            }
        },
        "category_identifiers": {
            "id": "#category_identifiers",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "mixins": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "kinds": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" },
                "actions": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }
            }
        },
        "model": {
            "id": "#model",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "mixins": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/mixin"
                    }
                },
                "kinds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/kind"
                    }
                },
                "actions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/action"
                    }
                }
            }
        }
    }
}