I'm trying to generate a python client for the REST API using https://github.com/openapi-generators/openapi-python-client/
Getting it to work requires a few tweaks in the generator but I think there is also a bug in the actual openapi JSON.
The generator issued an exception when looking at the schema for Property (https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/e45d4f725e25a95ec2b034238fd3736f19053a16/repo/rest-api/specs/global/schemas.json).
For some reason the API specifies the statements of the Property differently from the statements of Item (which parses correctly by the tool). I think they should be the same? I was able to get the tool to work by just deleting the selection of the Property schema:
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/Statement" },
{
"properties": {
"id": {
"example": "P31$6403c562-401a-2b26-85cc-8327801145e1"
}
}
}
]
}
}and replacing it with
"type": "object",
"additionalProperties": {
"type": "array",
"items": { "$ref": "#/Statement" }
}from the Item block above.
The id property that is being added seems redundant withe the id field in the Statement schema anyways? I don't think this is a breaking change.