Skip to content

Commit

Permalink
toolinfo: Extend schema to allow for multiple authors
Browse files Browse the repository at this point in the history
Extend schema to allow submission of an array of people as the author of
the tool. The legacy string type for this member is also allowed.

Bug: T293565
Change-Id: Ibcc1a3434062068dd2fb643b262be1b2e6c19b81
  • Loading branch information
bd808 authored and jenkins-bot committed Jan 31, 2022
1 parent 0256d73 commit 152d469
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .jsonschema-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ shouldSymlinkLatest: false
ignoreSchemas:
- /toolinfo/1.0.0
- /toolinfo/1.1.1
- /toolinfo/1.2.0
- /toolinfo/1.2.0
- /toolinfo/1.2.1
1 change: 1 addition & 0 deletions jsonschema/toolinfo/1.2.2
323 changes: 323 additions & 0 deletions jsonschema/toolinfo/1.2.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
{
"title": "toolinfo",
"description": "A tool is a piece of software that helps facilitate contribution toward, or consumption of, Wikimedia projects and associated data, not including the core MediaWiki software and its extensions.",
"$id": "/toolinfo/1.2.2",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"tool": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "Unique identifier for this tool. Must be unique for every tool. It is recommended you prefix your tool names to reduce the risk of clashes.",
"examples": [
"toolforge-admin",
"user-bdavis_wmf-GlobalWatchlistReset.js"
]
},
"title": {
"type": "string",
"maxLength": 255,
"description": "Human readable tool name. Recommended limit of 25 characters."
},
"description": {
"type": "string",
"maxLength": 65535,
"description": "A longer description of the tool. The recommended length for a description is 3-5 sentences. Future versions of this schema will impose a character limit."
},
"url": {
"$ref": "#/definitions/url",
"description": "A direct link to the tool or to instructions on how to use or install the tool."
},
"keywords": {
"type": "string",
"maxLength": 2047,
"description": "[DEPRECATED] Comma-delineated list of keywords. This parameter is deprecated and will be removed in the next major version.",
"$comment": "Remove in version 2."
},
"author": {
"oneOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "array",
"items": {
"$ref": "#/definitions/person"
}
}
],
"description": "The primary tool developers."
},
"repository": {
"$ref": "#/definitions/url",
"description": "A link to the repository where the tool code is hosted."
},
"subtitle": {
"type": "string",
"maxLength": 255,
"description": "Longer than the full title but shorter than the description. It should add some additional context to the title."
},
"openhub_id": {
"type": "string",
"maxLength": 255,
"description": "The project ID on OpenHub. Given a URL of https://openhub.net/p/foo, the project ID is `foo`."
},
"url_alternates": {
"type": "array",
"items": {
"$ref": "#/definitions/url_multilingual"
},
"description": "Alternate links to the tool or install documentation in different natural languages."
},
"bot_username": {
"type": "string",
"maxLength": 255,
"description": "If the tool is a bot, the Wikimedia username of the bot. Do not include 'User:' or similar prefixes."
},
"deprecated": {
"type": "boolean",
"default": false,
"description": "If true, the use of this tool is officially discouraged. The `replaced_by` parameter can be used to define a replacement."
},
"replaced_by": {
"$ref": "#/definitions/url",
"description": "If this tool is deprecated, this parameter should be used to link to the replacement tool."
},
"experimental": {
"type": "boolean",
"default": false,
"description": "If true, this tool is unstable and can change or go offline at any time."
},
"for_wikis": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/wiki"
}
},
{
"$ref": "#/definitions/wiki"
}
],
"default": "*",
"description": "A string or array of strings describing the wiki(s) this tool can be used on. Use hostnames such as `zh.wiktionary.org`. Use asterisks as wildcards. For example, `*.wikisource.org` means 'this tool works on all Wikisource wikis.' `*` means 'this works on all wikis, including Wikimedia wikis.'"
},
"icon": {
"$ref": "#/definitions/commons_file",
"description": "A link to a Wikimedia Commons file description page for an icon that depicts the tool."
},
"license": {
"type": "string",
"maxLength": 255,
"description": "The software license the tool code is available under. Use a standard SPDX license identifier like 'GPL-3.0-or-later'.",
"examples": [
"GPL-2.0-or-later",
"GPL-3.0-or-later"
]
},
"sponsor": {
"$ref": "#/definitions/string_or_string_array",
"description": "Organization that sponsored the tool's development."
},
"available_ui_languages": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/language"
}
},
{
"$ref": "#/definitions/language"
},
{
"type": "string",
"maxLength": 1,
"enum": [
"*"
]
}
],
"default": "en",
"description": "The language(s) the tool's interface has been translated into. Use ISO 639 language codes like `zh` and `scn`. If not defined it is assumed the tool is only available in English."
},
"technology_used": {
"$ref": "#/definitions/string_or_string_array",
"description": "A string or array of strings listing technologies (programming languages, development frameworks, etc.) used in creating the tool."
},
"tool_type": {
"type": "string",
"maxLength": 32,
"enum": [
"web app",
"desktop app",
"bot",
"gadget",
"user script",
"command line tool",
"coding framework",
"lua module",
"template",
"other"
],
"description": "The manner in which the tool is used. Select one from the list of options."
},
"api_url": {
"$ref": "#/definitions/url",
"description": "A link to the tool's API, if available."
},
"developer_docs_url": {
"$ref": "#/definitions/url_multilingual_or_array",
"description": "A link to the tool's developer documentation, if available."
},
"user_docs_url": {
"$ref": "#/definitions/url_multilingual_or_array",
"description": "A link to the tool's user documentation, if available."
},
"feedback_url": {
"$ref": "#/definitions/url_multilingual_or_array",
"description": "A link to location where the tool's user can leave feedback."
},
"privacy_policy_url": {
"$ref": "#/definitions/url_multilingual_or_array",
"description": "A link to the tool's privacy policy, if available."
},
"translate_url": {
"$ref": "#/definitions/url",
"description": "A link to the tool's translation interface."
},
"bugtracker_url": {
"$ref": "#/definitions/url",
"description": "A link to the tool's bug tracker on GitHub, Bitbucket, Phabricator, etc."
},
"_schema": {
"type": "string",
"format": "uri-reference",
"maxLength": 32,
"description": "A URI identifying the jsonschema for this toolinfo.json record. This should be a short uri containing only the name and revision at the end of the URI path.",
"examples": [
"/toolinfo/1.2.1"
]
},
"_language": {
"$ref": "#/definitions/language",
"default": "en",
"description": "The language in which this toolinfo record is written. If not set, the default value is English. Use ISO 639 language codes."
}
},
"required": [
"name",
"title",
"description",
"url"
]
},
"url": {
"type": "string",
"maxLength": 2047,
"format": "uri"
},
"wiki": {
"type": "string",
"maxLength": 255,
"pattern": "^(\\*|(.*)?\\.?(mediawiki|wiktionary|wiki(pedia|quote|books|source|news|versity|data|voyage|media))\\.org)$"
},
"commons_file": {
"$ref": "#/definitions/url",
"pattern": "^https://commons.wikimedia.org/wiki/File:.+\\..+$",
"maxLength": 2047
},
"language": {
"type": "string",
"maxLength": 16,
"pattern": "^(x-.*|[A-Za-z]{2,3}(-.*)?)$"
},
"url_multilingual": {
"type": "object",
"properties": {
"language": {
"$ref": "#/definitions/language"
},
"url": {
"$ref": "#/definitions/url"
}
}
},
"url_multilingual_or_array": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/url_multilingual"
}
},
{
"$ref": "#/definitions/url"
}
]
},
"string_or_string_array": {
"oneOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "array",
"items": {
"type": "string",
"maxLength": 255
}
}
]
},
"person": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "The full/formatted name of the person."
},
"wiki_username": {
"type": "string",
"maxLength": 255,
"description": "The person's Wikimedia username."
},
"developer_username": {
"type": "string",
"maxLength": 255,
"description": "The person's Wikimedia Developer account username."
},
"email": {
"type": "string",
"maxLength": 255,
"format": "email",
"description": "Email address"
},
"url": {
"$ref": "#/definitions/url",
"description": "Home page or other URL representing the person."
}
},
"required": [
"name"
]
}
},
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/tool"
}
},
{
"$ref": "#/definitions/tool"
}
]
}
37 changes: 33 additions & 4 deletions jsonschema/toolinfo/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
A tool is a piece of software that helps facilitate contribution toward, or
consumption of, Wikimedia projects and associated data, not including the
core MediaWiki software and its extensions.
$id: /toolinfo/1.2.1
$id: /toolinfo/1.2.2
$schema: http://json-schema.org/draft-07/schema#
definitions:
tool:
Expand Down Expand Up @@ -44,9 +44,13 @@ definitions:
deprecated and will be removed in the next major version.
$comment: Remove in version 2.
author:
type: string
maxLength: 255
description: The primary tool developer.
oneOf:
- type: string
maxLength: 255
- type: array
items:
$ref: "#/definitions/person"
description: The primary tool developers.
repository:
$ref: "#/definitions/url"
description: A link to the repository where the tool code is hosted.
Expand Down Expand Up @@ -243,6 +247,31 @@ definitions:
items:
type: string
maxLength: 255
person:
type: object
properties:
name:
type: string
maxLength: 255
description: The full/formatted name of the person.
wiki_username:
type: string
maxLength: 255
description: The person's Wikimedia username.
developer_username:
type: string
maxLength: 255
description: The person's Wikimedia Developer account username.
email:
type: string
maxLength: 255
format: email
description: Email address
url:
$ref: "#/definitions/url"
description: Home page or other URL representing the person.
required:
- name
oneOf:
- type: array
items:
Expand Down

0 comments on commit 152d469

Please sign in to comment.