mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
81 lines
3 KiB
YAML
81 lines
3 KiB
YAML
# Copyright 2018 New Vector Ltd
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
title: Protocol
|
|
type: object
|
|
properties:
|
|
user_fields:
|
|
description: |-
|
|
Fields which may be used to identify a third-party user. These should be
|
|
ordered to suggest the way that entities may be grouped, where higher
|
|
groupings are ordered first. For example, the name of a network should be
|
|
searched before the nickname of a user.
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: Field used to identify a third-party user.
|
|
example: ["network", "nickname"]
|
|
location_fields:
|
|
description: |-
|
|
Fields which may be used to identify a third-party location. These should be
|
|
ordered to suggest the way that entities may be grouped, where higher
|
|
groupings are ordered first. For example, the name of a network should be
|
|
searched before the name of a channel.
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: Field used to identify a third-party location.
|
|
example: ["network", "channel"]
|
|
icon:
|
|
description: A content URI representing an icon for the third-party protocol.
|
|
type: string
|
|
example: "mxc://example.org/aBcDeFgH"
|
|
field_types:
|
|
description: |-
|
|
The type definitions for the fields defined in `user_fields` and
|
|
`location_fields`. Each entry in those arrays MUST have an entry here.
|
|
The `string` key for this object is the field name itself.
|
|
|
|
May be an empty object if no fields are defined.
|
|
type: object
|
|
additionalProperties:
|
|
title: Field Type
|
|
description: Definition of valid values for a field.
|
|
type: object
|
|
properties:
|
|
regexp:
|
|
description: |-
|
|
A regular expression for validation of a field's value. This may be relatively
|
|
coarse to verify the value as the application service providing this protocol
|
|
may apply additional validation or filtering.
|
|
type: string
|
|
placeholder:
|
|
description: A placeholder serving as a valid example of the field value.
|
|
type: string
|
|
required: ['regexp', 'placeholder']
|
|
example: {
|
|
"network": {
|
|
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+",
|
|
"placeholder": "irc.example.org"
|
|
},
|
|
"nickname": {
|
|
"regexp": "[^\\s#]+",
|
|
"placeholder": "username"
|
|
},
|
|
"channel": {
|
|
"regexp": "#[^\\s]+",
|
|
"placeholder": "#foobar"
|
|
}
|
|
}
|
|
required: ['user_fields', 'location_fields', 'icon', 'field_types']
|