wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/rest-api/specs/global/schemas.json

Summary

Maintainability
Test Coverage
{
    "Item": {
        "type": "object",
        "properties": {
            "id": {
                "type": "string",
                "readOnly": true
            },
            "type": {
                "type": "string",
                "enum": [ "item" ],
                "readOnly": true
            },
            "labels": { "$ref": "#/Labels" },
            "descriptions": { "$ref": "#/Descriptions" },
            "aliases": { "$ref": "#/Aliases" },
            "sitelinks": {
                "$ref": "./schema-parts.json#/Sitelinks"
            },
            "statements": {
                "type": "object",
                "additionalProperties": {
                    "type": "array",
                    "items": { "$ref": "#/Statement" }
                }
            }
        }
    },
    "Property": {
        "type": "object",
        "properties": {
            "id": {
                "type": "string",
                "readOnly": true
            },
            "type": {
                "type": "string",
                "enum": [ "property" ],
                "readOnly": true
            },
            "data_type": {
                "type": "string"
            },
            "labels": { "$ref": "#/Labels" },
            "descriptions": { "$ref": "#/Descriptions" },
            "aliases": { "$ref": "#/Aliases" },
            "statements": {
                "type": "object",
                "additionalProperties": {
                    "type": "array",
                    "items": { "$ref": "#/Statement" }
                }
            }
        },
        "required": [ "data_type" ]
    },
    "Labels": {
        "type": "object",
        "additionalProperties": {
            "type": "string"
        }
    },    "Descriptions": {
        "type": "object",
        "additionalProperties": {
            "type": "string"
        }
    },
    "Aliases": {
        "type": "object",
        "additionalProperties": {
            "type": "array",
            "items": { "type": "string" }
        }
    },
    "Sitelink": {
        "type": "object",
        "properties": {
            "title": {
                "type": "string"
            },
            "badges": {
                "type": "array",
                "items": { "type": "string" }
            },
            "url": {
                "type": "string",
                "readOnly": true
            }
        },
        "required": [ "title" ]
    },
    "Statement": {
        "allOf": [
            {
                "type": "object",
                "properties": {
                    "id": {
                        "description": "The globally unique identifier for this Statement",
                        "type": "string",
                        "readOnly": true
                    },
                    "rank": {
                        "description": "The rank of the Statement",
                        "type": "string",
                        "enum": [ "deprecated", "normal", "preferred" ],
                        "default": "normal"
                    }
                }
            },
            { "$ref": "./schema-parts.json#/PropertyValuePair" },
            {
                "type": "object",
                "properties": {
                    "qualifiers": {
                        "type": "array",
                        "items": { "$ref": "#/Qualifier" },
                        "default": [ ]
                    },
                    "references": {
                        "type": "array",
                        "items": { "$ref": "#/Reference" },
                        "default": [ ]
                    }
                }
            }
        ]
    },
    "Qualifier": {
        "$ref": "./schema-parts.json#/PropertyValuePair"
    },
    "Reference": {
        "type": "object",
        "properties": {
            "hash": {
                "description": "Hash of the Reference",
                "type": "string",
                "readOnly": true
            },
            "parts": {
                "type": "array",
                "items": { "$ref": "./schema-parts.json#/PropertyValuePair" }
            }
        }
    }
}