Skip to content

Commit 7de9ca5

Browse files
Merge remote-tracking branch 'upstream/main' into test-funcs1
2 parents 4d3a8f8 + f0300db commit 7de9ca5

File tree

2 files changed

+75
-8
lines changed

2 files changed

+75
-8
lines changed

.github/workflows/validate.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ on:
77
- 'events/**/*.yaml'
88
- 'functions/**/*.yaml'
99
- 'schemas/**/*.yaml'
10+
pull_request:
11+
paths:
12+
- 'elements/**/*.yaml'
13+
- 'events/**/*.yaml'
14+
- 'functions/**/*.yaml'
15+
- 'schemas/**/*.yaml'
16+
workflow_dispatch:
1017

1118
jobs:
1219
validate:
1320
runs-on: ubuntu-latest
1421

1522
steps:
1623
- name: Checkout repository
17-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
25+
with:
26+
lfs: true
1827

1928
- name: Run validator
2029
run: |

schemas/function.yaml

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ type: object
55

66
properties:
77
shared:
8-
description: A shared specification of a function.
8+
description: |
9+
A shared specification of a function.
10+
You must always create a server and a client property, and merge this into both
11+
using a reference.
912
$ref: '#/$defs/common_properties'
1013
server:
1114
description: A server-side specification of a function.
@@ -26,6 +29,17 @@ $defs:
2629
pair:
2730
type: string
2831
description: Associates this function with another getter or setter function.
32+
oop:
33+
$ref: '#/$defs/oop'
34+
disabled:
35+
description: |
36+
Describe why the function was disabled, and if there is an alternative approach;
37+
or just set the property to "true".
38+
anyOf:
39+
- type: string
40+
- const: true
41+
meta:
42+
$ref: '#/$defs/meta'
2943
description:
3044
type: string
3145
description: Describes the functionality provided by the function.
@@ -58,18 +72,63 @@ $defs:
5872
$ref: '#/$defs/examples'
5973
see_also:
6074
type: array
61-
description: A list of other items and categories for further reading.
75+
description: |
76+
A list of other items and categories for further reading.
77+
Every function will implicitly display it's own category in *See Also*, unless you
78+
introduce this property, then you have to be explicit about it.
6279
items:
6380
type: string
6481
pattern: "^(item|category|tag):"
6582
uniqueItems: true
6683

84+
oop:
85+
type: object
86+
description: Object-Oriented Programming (OOP) information block for the function.
87+
required:
88+
- entity
89+
properties:
90+
note:
91+
type: string
92+
description: A piece of information to show alongside OOP syntax.
93+
entity:
94+
type: string
95+
description: Name of the element or userdata.
96+
oneOf:
97+
- required:
98+
- method
99+
properties:
100+
method:
101+
type: string
102+
description: Name of the method.
103+
static:
104+
type: boolean
105+
default: false
106+
description: If set to true, this method will be marked as static.
107+
variable:
108+
type: string
109+
description: Name of the variable without a leading dot.
110+
- required:
111+
- constructor
112+
properties:
113+
constructor:
114+
type: string
115+
description: Name of the constructor.
116+
117+
meta:
118+
type: array
119+
description: A list of meta properties about the function and it's documentation.
120+
items:
121+
type: object
122+
properties:
123+
needs_checking:
124+
type: string
125+
description: Describe why the function needs checking by another person. What's problematic?
126+
67127
preview:
68128
type: array
69129
description: A list of picture assets demonstrating the function.
70130
items:
71131
type: object
72-
description: A single function preview.
73132
required:
74133
- path
75134
properties:
@@ -85,7 +144,6 @@ $defs:
85144
description: A list of required and optional parameters for the function.
86145
items:
87146
type: object
88-
description: A single function parameter.
89147
required:
90148
- name
91149
- type
@@ -123,7 +181,6 @@ $defs:
123181
description: A list of named values returned by the function.
124182
items:
125183
type: object
126-
description: A single function return value.
127184
required:
128185
- type
129186
- name
@@ -147,13 +204,15 @@ $defs:
147204
deprecated:
148205
type: string
149206
description: Version when this item was deprecated in MTA.
207+
replacement:
208+
type: string
209+
description: An optional replacement for this item.
150210

151211
issues:
152212
type: array
153213
description: A list of related issues for this function.
154214
items:
155215
type: object
156-
description: A single function-related issue.
157216
required:
158217
- id
159218
- description
@@ -170,7 +229,6 @@ $defs:
170229
description: A list of source code examples demonstrating the function.
171230
items:
172231
type: object
173-
description: A single source code example.
174232
required:
175233
- path
176234
properties:

0 commit comments

Comments
 (0)