wikimedia/mediawiki-extensions-Wikibase

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

Summary

Maintainability
Test Coverage
{
    "PatchRequest": {
        "allOf": [
            { "$ref": "#/PatchDocument" },
            { "$ref": "#/MediawikiEdit" }
        ]
    },
    "StatementRequest": {
        "allOf": [
            {
                "type": "object",
                "properties": {
                    "statement": {
                        "allOf": [
                            { "$ref": "./schemas.json#/Statement" },
                            { "$ref": "#/StatementRequestRequired" }
                        ]
                    }
                },
                "required": [ "statement" ]
            },
            { "$ref": "./request-parts.json#/MediawikiEdit" }
        ]
    },
    "StatementPatchRequest": {
        "allOf": [
            { "$ref": "#/PatchDocument" },
            {
                "properties": {
                    "patch": {
                        "items": {
                            "properties": {
                                "path": {
                                    "example": "/value/content"
                                },
                                "value": {
                                    "example": "Q5"
                                }
                            }
                        }
                    }
                }
            },
            { "$ref": "#/MediawikiEdit" }
        ]
    },
    "StatementRequestRequired": {
        "allOf": [
            { "$ref": "#/PropertyValuePairRequestRequired" },
            {
                "properties": {
                    "qualifiers": {
                        "items": {
                            "$ref": "#/QualifierRequestRequired"
                        }
                    },
                    "references": {
                        "items": {
                            "$ref": "#/ReferenceRequestRequired"
                        }
                    }
                }
            }
        ]
    },
    "QualifierRequestRequired": {
        "$ref": "#/PropertyValuePairRequestRequired"
    },
    "ReferenceRequestRequired": {
        "required": [ "parts" ],
        "properties": {
            "parts": {
                "items": {
                    "$ref": "#/PropertyValuePairRequestRequired"
                }
            }
        }
    },
    "PropertyValuePairRequestRequired": {
        "required": [ "property", "value" ],
        "properties": {
            "property": {
                "required": [ "id" ]
            },
            "value": {
                "required": [ "type" ]
            }
        }
    },
    "MediawikiEdit": {
        "type": "object",
        "properties": {
            "tags": {
                "type": "array",
                "items": { "type": "string" },
                "default": [ ]
            },
            "bot": {
                "type": "boolean",
                "default": false
            },
            "comment": { "type": "string" }
        }
    },
    "PatchDocument": {
        "type": "object",
        "properties": {
            "patch": {
                "description": "A JSON Patch document as defined by RFC 6902",
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "op": {
                            "description": "The operation to perform",
                            "type": "string",
                            "enum": [
                                "add",
                                "copy",
                                "move",
                                "remove",
                                "replace",
                                "test"
                            ]
                        },
                        "path": {
                            "description": "A JSON Pointer",
                            "type": "string"
                        },
                        "from": {
                            "description": "A JSON Pointer",
                            "type": "string"
                        },
                        "value": {
                            "description": "The value to be used within the operation"
                        }
                    },
                    "required": [ "op", "path" ]
                }
            }
        },
        "required": [ "patch" ]
    }
}