Skip to content

Commit 84c8085

Browse files
committed
Extend function scheme
1 parent ff5f7ed commit 84c8085

File tree

1 file changed

+121
-12
lines changed

1 file changed

+121
-12
lines changed

schemas/function.yaml

+121-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ $id: /schemas/function
33
title: Function schema
44
type: object
55

6+
properties:
7+
shared:
8+
description: A shared specification of a function.
9+
$ref: '#/$defs/common_properties'
10+
server:
11+
description: A server-side specification of a function.
12+
$ref: '#/$defs/common_properties'
13+
client:
14+
description: A client-side specification of a function.
15+
$ref: '#/$defs/common_properties'
16+
617
$defs:
718
common_properties:
819
type: object
@@ -18,12 +29,103 @@ $defs:
1829
description:
1930
type: string
2031
description: Describes the functionality provided by the function.
32+
notes:
33+
type: array
34+
description: List of noteworthy pieces of information for the function.
35+
items:
36+
type: string
37+
preview:
38+
$ref: '#/$defs/preview'
39+
parameters:
40+
$ref: '#/$defs/parameters'
41+
ignore_parameters:
42+
type: array
43+
description: |
44+
A list of parameters to remove from the parameters list.
45+
You should only use this for shared functions, for example where the client function is
46+
missing a player parameter
47+
items:
48+
type: string
49+
uniqueItems: true
50+
returns:
51+
$ref: '#/$defs/returns'
2152
version:
2253
description: Version information when the function got added/deprecated/removed.
2354
$ref: '#/$defs/version'
55+
issues:
56+
$ref: '#/$defs/issues'
2457
examples:
2558
$ref: '#/$defs/examples'
59+
see_also:
60+
type: array
61+
description: A list of other items and categories for further reading.
62+
items:
63+
type: string
64+
pattern: "^(item|category|tag):"
65+
uniqueItems: true
2666

67+
preview:
68+
type: array
69+
description: A list of picture assets demonstrating the function.
70+
items:
71+
type: object
72+
description: A single function preview.
73+
required:
74+
- path
75+
properties:
76+
path:
77+
type: string
78+
description: A relative or repository-absolute path to an asset file.
79+
description:
80+
type: string
81+
description: Brief summary of the content in the picture.
82+
83+
parameters:
84+
type: array
85+
description: A list of required and optional parameters for the function.
86+
items:
87+
type: object
88+
description: A single function parameter.
89+
required:
90+
- name
91+
- type
92+
- description
93+
properties:
94+
name:
95+
type: string
96+
description: Name of the function parameter.
97+
type:
98+
type: string
99+
description: Type of the function parameter.
100+
description:
101+
type: string
102+
description: Describe the usage, contraints and other useful information about the parameter.
103+
104+
returns:
105+
type: object
106+
required:
107+
- values
108+
properties:
109+
description:
110+
type: string
111+
description: A summary for the return values.
112+
values:
113+
type: array
114+
description: A list of named values returned by the function.
115+
items:
116+
type: object
117+
description: A single function return value.
118+
required:
119+
- type
120+
- name
121+
properties:
122+
type:
123+
type: string
124+
description: Type of the return value.
125+
name:
126+
type: string
127+
description: Name of the return value.
128+
27129
version:
28130
type: object
29131
properties:
@@ -37,11 +139,29 @@ $defs:
37139
type: string
38140
description: Version when this item was deprecated in MTA.
39141

142+
issues:
143+
type: array
144+
description: A list of related issues for this function.
145+
items:
146+
type: object
147+
description: A single function-related issue.
148+
required:
149+
- id
150+
- description
151+
properties:
152+
id:
153+
type: integer
154+
description: Numeric identifier of the GitHub issue.
155+
description:
156+
type: string
157+
description: Description or summary for this GitHub issue.
158+
40159
examples:
41-
description: A list of source code examples demonstrating the function.
42160
type: array
161+
description: A list of source code examples demonstrating the function.
43162
items:
44163
type: object
164+
description: A single source code example.
45165
required:
46166
- path
47167
properties:
@@ -55,14 +175,3 @@ $defs:
55175
type: boolean
56176
default: false
57177
description: If set to true, this example will be appended to the previous example.
58-
59-
properties:
60-
shared:
61-
description: A shared specification of a function.
62-
$ref: '#/$defs/common_properties'
63-
server:
64-
description: A server-side specification of a function.
65-
$ref: '#/$defs/common_properties'
66-
client:
67-
description: A client-side specification of a function.
68-
$ref: '#/$defs/common_properties'

0 commit comments

Comments
 (0)