Skip to content

Commit 2ae1381

Browse files
committed
Synced solved
2 parents 32cbab6 + f4469ef commit 2ae1381

File tree

1 file changed

+25
-120
lines changed

1 file changed

+25
-120
lines changed

schemas/function.yaml

Lines changed: 25 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$schema: https://json-schema.org/draft/2020-12/schema
2-
$id: /schemas/function
2+
$id: function.yaml
33
title: Function schema
44
type: object
55

@@ -26,6 +26,9 @@ $defs:
2626
name:
2727
type: string
2828
description: Name of the function.
29+
description:
30+
type: string
31+
description: Describes the functionality provided by the function.
2932
pair:
3033
type: string
3134
description: Associates this function with another getter or setter function.
@@ -38,56 +41,26 @@ $defs:
3841
anyOf:
3942
- type: string
4043
- const: true
41-
meta:
42-
$ref: '#/$defs/meta'
43-
description:
44-
type: string
45-
description: Describes the functionality provided by the function.
46-
important_notes:
47-
type: array
48-
description: |
49-
A list of important notes about the function.
50-
This is a list of things that are important to know about the function, but not
51-
necessarily related to the function itself.
52-
items:
53-
type: string
54-
notes:
55-
type: array
56-
description: List of noteworthy pieces of information for the function.
57-
items:
58-
type: string
59-
preview_images:
60-
$ref: '#/$defs/preview_images'
6144
parameters:
6245
$ref: '#/$defs/parameters'
6346
ignore_parameters:
64-
type: array
65-
description: |
66-
A list of parameters to remove from the parameters list.
67-
You should only use this for shared functions, for example where the client function is
68-
missing a player parameter
69-
items:
70-
type: string
71-
uniqueItems: true
47+
$ref: '#/$defs/ignore_parameters'
7248
returns:
7349
$ref: '#/$defs/returns'
50+
meta:
51+
$ref: 'common-defs.yaml#/$defs/meta'
52+
notes:
53+
$ref: 'common-defs.yaml#/$defs/notes'
54+
preview_images:
55+
$ref: 'common-defs.yaml#/$defs/preview_images'
7456
version:
75-
description: Version information when the function got added/deprecated/removed.
76-
$ref: '#/$defs/version'
57+
$ref: 'common-defs.yaml#/$defs/version'
7758
issues:
78-
$ref: '#/$defs/issues'
59+
$ref: 'common-defs.yaml#/$defs/issues'
7960
examples:
80-
$ref: '#/$defs/examples'
61+
$ref: 'common-defs.yaml#/$defs/examples'
8162
see_also:
82-
type: array
83-
description: |
84-
A list of other categories for further reading.
85-
Every function will implicitly display it's own category in *See Also*, unless you
86-
introduce this property, then you have to be explicit about it.
87-
items:
88-
type: string
89-
pattern: "^(category):"
90-
uniqueItems: true
63+
$ref: 'common-defs.yaml#/$defs/see_also'
9164

9265
oop:
9366
type: object
@@ -122,31 +95,6 @@ $defs:
12295
type: string
12396
description: Name of the constructor.
12497

125-
meta:
126-
type: array
127-
description: A list of meta properties about the function and it's documentation.
128-
items:
129-
type: object
130-
properties:
131-
needs_checking:
132-
type: string
133-
description: Describe why the function needs checking by another person. What's problematic?
134-
135-
preview_images:
136-
type: array
137-
description: A list of picture assets demonstrating the function.
138-
items:
139-
type: object
140-
required:
141-
- path
142-
properties:
143-
path:
144-
type: string
145-
description: A relative or repository-absolute path to an asset file.
146-
description:
147-
type: string
148-
description: Brief summary of the content in the picture.
149-
15098
parameters:
15199
type: array
152100
description: A list of required and optional parameters for the function.
@@ -171,7 +119,15 @@ $defs:
171119
description: |
172120
The default value for this parameter, if none was given in the call to the function.
173121
This property automatically implicitly marks this parameter as optional.
174-
122+
ignore_parameters:
123+
type: array
124+
description: |
125+
A list of parameters to remove from the parameters list.
126+
You should only use this for shared functions, for example where the client function is
127+
missing a player parameter
128+
items:
129+
type: string
130+
uniqueItems: true
175131
returns:
176132
type: object
177133
required:
@@ -194,55 +150,4 @@ $defs:
194150
description: Type of the return value.
195151
name:
196152
type: string
197-
description: Name of the return value.
198-
199-
version:
200-
type: object
201-
properties:
202-
added:
203-
type: string
204-
description: Version when this item was added to MTA.
205-
removed:
206-
type: string
207-
description: Version when this item was removed from MTA.
208-
deprecated:
209-
type: string
210-
description: Version when this item was deprecated in MTA.
211-
replacement:
212-
type: string
213-
description: An optional replacement for this item.
214-
215-
issues:
216-
type: array
217-
description: A list of related issues for this function.
218-
items:
219-
type: object
220-
required:
221-
- id
222-
- description
223-
properties:
224-
id:
225-
type: integer
226-
description: Numeric identifier of the GitHub issue.
227-
description:
228-
type: string
229-
description: Description or summary for this GitHub issue.
230-
231-
examples:
232-
type: array
233-
description: A list of source code examples demonstrating the function.
234-
items:
235-
type: object
236-
required:
237-
- path
238-
properties:
239-
path:
240-
type: string
241-
description: A relative or repository-absolute path to an example source file.
242-
description:
243-
type: string
244-
description: Description for this source code example.
245-
append:
246-
type: boolean
247-
default: false
248-
description: If set to true, this example will be appended to the previous example.
153+
description: Name of the return value.

0 commit comments

Comments
 (0)