| 1 | { |
| 2 | "$schema": "http://json-schema.org/draft-06/schema#", |
| 3 | "$id": "https://www.mediawiki.org/schema/discovery-1.0", |
| 4 | "title": "MediaWiki REST API discovery document", |
| 5 | "description": "Discovery documents provide all information needed to locate and access REST APIs on a given wiki.", |
| 6 | "type": "object", |
| 7 | "required": [ "info", "servers", "modules" ], |
| 8 | "properties": { |
| 9 | "mw-discovery": { |
| 10 | "description": "The version of the MediaWiki discovery schema used by the discovery document.", |
| 11 | "type": "string" |
| 12 | }, |
| 13 | "info": { |
| 14 | "$ref": "#/definitions/Info" |
| 15 | }, |
| 16 | "servers": { |
| 17 | "description": "A list of servers that can be used to access the APIs.", |
| 18 | "type": "array", |
| 19 | "minItems": 1, |
| 20 | "item": { "$ref": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Server" } |
| 21 | }, |
| 22 | "modules": { |
| 23 | "description": "Information about the API modules available for interacting with the wiki. Depends on the extensions installed on the wiki, and may further vary with the wiki's version and configuration.", |
| 24 | "type": "object", |
| 25 | "minProperties": 1, |
| 26 | "additionalProperties": { "$ref": "#/definitions/Module" } |
| 27 | } |
| 28 | }, |
| 29 | "definitions": { |
| 30 | "Info": { |
| 31 | "description": "Information about the wiki site that offers the API", |
| 32 | "type": "object", |
| 33 | "required": [ |
| 34 | "title", |
| 35 | "mediawiki" |
| 36 | ], |
| 37 | "properties": { |
| 38 | "title": { |
| 39 | "description": "The name of the wiki", |
| 40 | "type": "string" |
| 41 | }, |
| 42 | "license": { |
| 43 | "$ref": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/License" |
| 44 | }, |
| 45 | "contact": { |
| 46 | "$ref": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Contact" |
| 47 | }, |
| 48 | "mediawiki": { |
| 49 | "description": "The version of the MediaWiki software serving the document", |
| 50 | "type": "string" |
| 51 | } |
| 52 | } |
| 53 | }, |
| 54 | "Module": { |
| 55 | "title": "REST API Module", |
| 56 | "description": "Information about a given REST module available of the wiki. Corresponds to the https://www.mediawiki.org/schema/mwapi-1.0 schema.", |
| 57 | "type": "object", |
| 58 | "required": [ |
| 59 | "info", |
| 60 | "base", |
| 61 | "spec" |
| 62 | ], |
| 63 | "properties": { |
| 64 | "info": { |
| 65 | "$ref": "#/definitions/ModuleInfo" |
| 66 | }, |
| 67 | "base": { |
| 68 | "description": "The base path of the module, to be appended to the server URL. This may or may not be a functioning endpoint, as defined by the module's specification.", |
| 69 | "type": "string" |
| 70 | }, |
| 71 | "spec": { |
| 72 | "description": "URL of the module's OpenAPI specification. The version of OpenAPI used may vary.", |
| 73 | "type": "string" |
| 74 | } |
| 75 | } |
| 76 | }, |
| 77 | "ModuleInfo": { |
| 78 | "$ref": "https://www.mediawiki.org/schema/mwapi-1.0#/definitions/Info" |
| 79 | } |
| 80 | } |
| 81 | } |