Skip to content

Commit d6305ba

Browse files
Change: Make the options schema stricter
1 parent d7eb645 commit d6305ba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/schema/v1/options.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"$defs": {
77
"flipDirection": {
88
"type": "string",
9-
"enum": ["horizontal", "vertical", "both"]
9+
"enum": ["none", "horizontal", "vertical", "both"]
1010
},
1111
"rotation": {
1212
"type": "number",
@@ -92,13 +92,13 @@
9292
}
9393
},
9494
"patternProperties": {
95-
"Probability$": {
95+
"^[a-z][A-Za-z0-9]+Probability$": {
9696
"type": "number",
9797
"description": "Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.",
9898
"minimum": 0,
9999
"maximum": 100
100100
},
101-
"Variant$": {
101+
"^[a-z][A-Za-z0-9]+Variant$": {
102102
"description": "Specifies which variants of the avatar part can be selected by the PRNG. If specified as a string or as an array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options.",
103103
"oneOf": [
104104
{
@@ -112,7 +112,7 @@
112112
}
113113
]
114114
},
115-
"Color$": {
115+
"^[a-z][A-Za-z0-9]+Color$": {
116116
"description": "Specifies which colors for the avatar component can be selected by the PRNG. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options. The color must be specified as a hex value.",
117117
"oneOf": [
118118
{
@@ -126,7 +126,7 @@
126126
}
127127
]
128128
},
129-
"(^r|R)otation": {
129+
"^(r|[a-z][A-Za-z0-9]+R)otation": {
130130
"description": "This is the rotation angle for the avatar or its parts. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If not preceded by an avatar part, the option applies to the entire avatar.",
131131
"oneOf": [
132132
{
@@ -142,7 +142,7 @@
142142
}
143143
]
144144
},
145-
"(^v|V)erticalOffset$": {
145+
"^(v|[a-z][A-Za-z0-9]+V)erticalOffset$": {
146146
"description": "This is the vertical offset of the avatar or its parts. This value can be an integer or a float. A value of 0 results in no offset, while positive values move the part down as a percentage and negative values move it up as a percentage. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If no avatar part is specified, the option applies to the entire avatar.",
147147
"oneOf": [
148148
{
@@ -158,7 +158,7 @@
158158
}
159159
]
160160
},
161-
"(^h|H)orizontalOffset$": {
161+
"^(h|[a-z][A-Za-z0-9]+H)orizontalOffset$": {
162162
"description": "This is the horizontal offset of the avatar or its parts. This value can be an integer or a float. A value of 0 results in no offset, while positive values move the part to the right as a percentage and negative values move it to the left as a percentage. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If no avatar part is specified, the option applies to the entire avatar.",
163163
"oneOf": [
164164
{

0 commit comments

Comments
 (0)