JSON Response schema

Download JSON file

{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "oph_response",
        "description": "Ophidia Response JSON Schema (1.1)",
        "definitions":
        {
                "textContent":
                {
                        "type": "object",
                        "description": "text result",
                        "properties":
                        {
                                "objclass": "text",
                                "objkey":
                                {
                                        "type": "string",
                                        "description": "a valid objkey depending on the submitted operation"
                                },
                                "objcontent":
                                {
                                        "type": "array",
                                        "description": "list of the results associated with the object",
                                        "items":
                                        {
                                                "type": "object",
                                                "description": "text result",
                                                "properties":
                                                {
                                                        "title":
                                                        {
                                                                "type": "string",
                                                                "description": "result"
                                                        },
                                                        "message":
                                                        {
                                                                "type": "string",
                                                                "description": "additional information"
                                                        }
                                                },
                                                "required": ["title"],
                                                "additionalProperties": false
                                        },
                                        "minItems": 1,
                                        "uniqueItems": false
                                }
                        },
                        "required": ["objclass", "objkey", "objcontent"],
                        "additionalProperties": false
                },
                "gridContent":
                {
                        "type": "object",
                        "description": "grid result",
                        "properties":
                        {
                                "objclass": "grid",
                                "objkey":
                                {
                                        "type": "string",
                                        "description": "a valid objkey depending on the submitted operation"
                                },
                                "objcontent":
                                {
                                        "type": "array",
                                        "description": "list of the results associated with the object",
                                        "items":
                                        {
                                                "type": "object",
                                                "description": "grid result",
                                                "properties":
                                                {
                                                        "title":
                                                        {
                                                                "type": "string",
                                                                "description": "table title"
                                                        },
                                                        "rowkeys":
                                                        {
                                                                "type": "array",
                                                                "description": "column headings",
                                                                "items":
                                                                {
                                                                        "type": "string",
                                                                        "description": "column title"
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": false
                                                        },
                                                        "rowfieldtypes":
                                                        {
                                                                "type": "array",
                                                                "description": "column data types",
                                                                "items":
                                                                {
                                                                        "type": "string",
                                                                        "description": "column data type"
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": false
                                                        },
                                                        "rowvalues":
                                                        {
                                                                "type": "array",
                                                                "description": "table rows",
                                                                "items":
                                                                {
                                                                        "type": "array",
                                                                        "description": "items of a row",
                                                                        "items":
                                                                        {
                                                                                "type": "string",
                                                                                "description": "item of row"
                                                                        },
                                                                        "minItems": 1,
                                                                        "uniqueItems": false
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": false
                                                        }
                                                },
                                                "required": ["title", "rowkeys", "rowfieldtypes", "rowvalues"],
                                                "additionalProperties": false
                                        },
                                        "minItems": 1,
                                        "uniqueItems": false
                                }
                        },
                        "required": ["objclass", "objkey", "objcontent"],
                        "additionalProperties": false
                },
                "graphContent":
                {
                        "type": "object",
                        "description": "graph result",
                        "properties":
                        {
                                "objclass": "digraph",
                                "objkey":
                                {
                                        "type": "string",
                                        "description": "a valid objkey depending on the submitted operation"
                                },
                                "objcontent":
                                {
                                        "type": "array",
                                        "description": "list of the results associated with the object",
                                        "items":
                                        {
                                                "type": "object",
                                                "description": "graph result",
                                                "properties":
                                                {
                                                        "title":
                                                        {
                                                                "type": "string",
                                                                "description": "graph title"
                                                        },
                                                        "nodekeys":
                                                        {
                                                                "type": "array",
                                                                "description": "names of the labels associated with graph nodes",
                                                                "items":
                                                                {
                                                                        "type": "string",
                                                                        "description": "label name"
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": false
                                                        },
                                                        "nodevalues":
                                                        {
                                                                "type": "array",
                                                                "description": "values of the labels associated with graph nodes",
                                                                "items":
                                                                {
                                                                        "type": "string",
                                                                        "description": "label value"
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": false
                                                        },
                                                        "nodelinks":
                                                        {
                                                                "type": "array",
                                                                "description": "adjacency matrix",
                                                                "items":
                                                                {
                                                                        "type": "array",
                                                                        "description": "list of the links from a given node to the others",
                                                                        "items":
                                                                        {
                                                                                "type": "object",
                                                                                "description": "link features",
                                                                                "properties":
                                                                                {
                                                                                        "node":
                                                                                        {
                                                                                                "type": "string",
                                                                                                "description": "index of the destination node"
                                                                                        },
                                                                                        "description":
                                                                                        {
                                                                                                "type": "string",
                                                                                                "description": "label associated with the link"
                                                                                        }
                                                                                },
                                                                                "required": ["node", "description"],
                                                                                "additionalProperties": false
                                                                        },
                                                                        "minItems": 1,
                                                                        "uniqueItems": true
                                                                },
                                                                "minItems": 1,
                                                                "uniqueItems": true
                                                        }
                                                },
                                                "required": ["title", "rowkeys", "rowfieldtypes", "rowvalues"],
                                                "additionalProperties": false
                                        },
                                        "minItems": 1,
                                        "uniqueItems": false
                                }
                        },
                        "required": ["objclass", "objkey", "objcontent"],
                        "additionalProperties": false
                }
        }
        "type": "object",
        "properties":
        {
                "response":
                {
                        "type": "array",
                        "description": "result array",
                        "items":
                        {
                                "anyOf":
                                [
                                        { "$ref": "#/definitions/textContent" },
                                        { "$ref": "#/definitions/gridContent" },
                                        { "$ref": "#/definitions/graphContent" }
                                ]
                        },
                        "minItems": 1,
                        "uniqueItems": true
                },
                "responseKeyset":
                {
                        "type": "array",
                        "description": "result index",
                        "items":
                        {
                                "type": "string",
                                "description": "identifier of a result. It must be a valid objkey or 'status'"
                        },
                        "minItems": 1,
                        "uniqueItems": true,
                        "required": ["status"]
                },
                "source":
                {
                        "type": "object",
                        "description": "service description and related metadata",
                        "properties":
                        {
                                "srckey":
                                {
                                        "type": "string",
                                        "default": "oph",
                                        "description": "service type identifier"
                                },
                                "srcname":
                                {
                                        "type": "string",
                                        "default": "Ophidia",
                                        "description": "service type"
                                },
                                "description":
                                {
                                        "type": "string",
                                        "default": "Ophidia Data Source",
                                        "description": "service description"
                                },
                                "producer":
                                {
                                        "type": "string",
                                        "description": "userid of the submitter"
                                },
                                "keys":
                                {
                                        "type": "array",
                                        "description": "metadata key list",
                                        "items":
                                        {
                                                "type": "string",
                                                "description": "metadata key"
                                        },
                                        "minItems": 4,
                                        "uniqueItems": true,
                                        "allOf": ["Session Code", "Workflow", "Marker", "JobID"]
                                },
                                "values":
                                {
                                        "type": "array",
                                        "description": "metadata value list",
                                        "items":
                                        {
                                                "type": "string",
                                                "description": "metadata value"
                                        },
                                        "minItems": 4,
                                        "uniqueItems": false
                                }
                        }
                        "required": ["srckey", "keys", "values"],
                        "additionalProperties": false
                },
                "consumers":
                {
                        "type": "array",
                        "description": "receiver list",
                        "items":
                        {
                                "type": "string",
                                "description": "userid of a receiver"
                        },
                        "minItems": 1,
                        "uniqueItems": true
                },
                "extra":
                {
                        "type": "object",
                        "description": "additional metadata",
                        "items":
                        {
                                "keys":
                                {
                                        "type": "array",
                                        "description": "metadata key list",
                                        "items":
                                        {
                                                "type": "string",
                                                "description": "metadata key"
                                        },
                                        "minItems": 1,
                                        "uniqueItems": true
                                },
                                "values":
                                {
                                        "type": "array",
                                        "description": "metadata value list",
                                        "items":
                                        {
                                                "type": "string",
                                                "description": "metadata value"
                                        },
                                        "minItems": 1,
                                        "uniqueItems": false
                                }
                        },
                        "required": ["keys", "values"],
                        "additionalProperties": false
                }
        },
        "required": ["response", "responsekeyset", "source", "consumers"],
        "additionalProperties": false
}