|
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 |
| -title: Protocol |
15 |
| -type: object |
16 |
| -properties: |
17 |
| - user_fields: |
18 |
| - description: |- |
19 |
| - Fields which may be used to identify a third-party user. These should be |
20 |
| - ordered to suggest the way that entities may be grouped, where higher |
21 |
| - groupings are ordered first. For example, the name of a network should be |
22 |
| - searched before the nickname of a user. |
23 |
| - type: array |
24 |
| - items: |
25 |
| - type: string |
26 |
| - description: Field used to identify a third-party user. |
27 |
| - example: ["network", "nickname"] |
28 |
| - location_fields: |
29 |
| - description: |- |
30 |
| - Fields which may be used to identify a third-party location. These should be |
31 |
| - ordered to suggest the way that entities may be grouped, where higher |
32 |
| - groupings are ordered first. For example, the name of a network should be |
33 |
| - searched before the name of a channel. |
34 |
| - type: array |
35 |
| - items: |
36 |
| - type: string |
37 |
| - description: Field used to identify a third-party location. |
38 |
| - example: ["network", "channel"] |
39 |
| - icon: |
40 |
| - description: A content URI representing an icon for the third-party protocol. |
41 |
| - type: string |
42 |
| - example: "mxc://example.org/aBcDeFgH" |
43 |
| - field_types: |
44 |
| - description: |- |
45 |
| - The type definitions for the fields defined in `user_fields` and |
46 |
| - `location_fields`. Each entry in those arrays MUST have an entry here. |
47 |
| - The `string` key for this object is the field name itself. |
48 |
| -
|
49 |
| - May be an empty object if no fields are defined. |
50 |
| - type: object |
51 |
| - additionalProperties: |
52 |
| - title: Field Type |
53 |
| - description: Definition of valid values for a field. |
54 |
| - type: object |
55 |
| - properties: |
56 |
| - regexp: |
57 |
| - description: |- |
58 |
| - A regular expression for validation of a field's value. This may be relatively |
59 |
| - coarse to verify the value as the application service providing this protocol |
60 |
| - may apply additional validation or filtering. |
61 |
| - type: string |
62 |
| - placeholder: |
63 |
| - description: A placeholder serving as a valid example of the field value. |
64 |
| - type: string |
65 |
| - required: ['regexp', 'placeholder'] |
66 |
| - example: { |
67 |
| - "network": { |
68 |
| - "regexp": "([a-z0-9]+\\.)*[a-z0-9]+", |
69 |
| - "placeholder": "irc.example.org" |
70 |
| - }, |
71 |
| - "nickname": { |
72 |
| - "regexp": "[^\\s#]+", |
73 |
| - "placeholder": "username" |
74 |
| - }, |
75 |
| - "channel": { |
76 |
| - "regexp": "#[^\\s]+", |
77 |
| - "placeholder": "#foobar" |
78 |
| - } |
79 |
| - } |
80 |
| - instances: |
81 |
| - description: |- |
82 |
| - A list of objects representing independent instances of configuration. |
83 |
| - For example, multiple networks on IRC if multiple are provided by the |
84 |
| - same application service. |
85 |
| - type: array |
86 |
| - items: |
87 |
| - type: object |
88 |
| - title: Protocol Instance |
89 |
| - properties: |
90 |
| - desc: |
91 |
| - type: string |
92 |
| - description: A human-readable description for the protocol, such as the name. |
93 |
| - example: "Freenode" |
94 |
| - icon: |
95 |
| - type: string |
96 |
| - description: |- |
97 |
| - An optional content URI representing the protocol. Overrides the one provided |
98 |
| - at the higher level Protocol object. |
99 |
| - example: "mxc://example.org/JkLmNoPq" |
100 |
| - fields: |
101 |
| - type: object |
102 |
| - description: Preset values for `fields` the client may use to search by. |
103 |
| - example: { |
104 |
| - "network": "freenode" |
105 |
| - } |
106 |
| - network_id: |
107 |
| - type: string |
108 |
| - description: A unique identifier across all instances. |
109 |
| - example: "freenode" |
110 |
| - required: ['desc', 'fields', 'network_id'] |
111 |
| -required: ['user_fields', 'location_fields', 'icon', 'field_types', 'instances'] |
| 14 | +allOf: |
| 15 | +- $ref: protocol_base.yaml |
| 16 | +- type: object |
| 17 | + properties: |
| 18 | + instances: |
| 19 | + description: |- |
| 20 | + A list of objects representing independent instances of configuration. |
| 21 | + For example, multiple networks on IRC if multiple are provided by the |
| 22 | + same application service. |
| 23 | + type: array |
| 24 | + items: |
| 25 | + $ref: protocol_instance.yaml |
0 commit comments