Skip to content

Commit 982258c

Browse files
committed
Add ' to some properties of the errors messages
1 parent d9067b3 commit 982258c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

doc/files/JSON-CONFIG-FILE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Returned error:
142142
{
143143
"error": JSONProperty.Errors.OBJECT_ONE_IS_REQUIRED,
144144
"properties": ["student", "employee"],
145-
"as_text": "One of this properties needs to be specified: student, employee."
145+
"as_text": "One of this properties needs to be specified: ['student', 'employee']."
146146
}
147147
]
148148
```
@@ -167,7 +167,7 @@ Returned error:
167167
{
168168
"error": JSONProperty.Errors.OBJECT_EXCLUSIVITY_ERROR,
169169
"properties": ["student", "employee"],
170-
"as_text": "This properties can not be present at the same time: student, employee."
170+
"as_text": "This properties can not be present at the same time: ['student', 'employee']."
171171
}
172172
]
173173
```

doc/files/JSON-PROPERTY-OBJECT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Returned error:
176176
"error": JSONProperty.Errors.OBJECT_ONE_IS_REQUIRED,
177177
"properties": ["student", "employee"],
178178
"context": "person",
179-
"as_text": "One of this properties needs to be specified: student, employee, at 'person'."
179+
"as_text": "One of this properties needs to be specified: ['student', 'employee'], at 'person'."
180180
}
181181
]
182182
```
@@ -204,7 +204,7 @@ Returned error:
204204
"error": JSONProperty.Errors.OBJECT_EXCLUSIVITY_ERROR,
205205
"properties": ["student", "employee"],
206206
"context": "person",
207-
"as_text": "This properties can not be present at the same time: student, employee, at 'person'."
207+
"as_text": "This properties can not be present at the same time: ['student', 'employee'], at 'person'."
208208
}
209209
]
210210
```

json_config_file/json_properties/json_property.gd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ const MESSAGE_WITHOUT_CONTEXT = "."
128128
static func _array_as_text(array: Array) -> String:
129129
var array_as_text = ""
130130

131-
for i in array.size():
131+
for i in range(array.size()):
132132
if i == 0:
133-
array_as_text = String(array[0])
133+
array_as_text = "['" + String(array[0]) + "'"
134+
elif i == array.size() - 1:
135+
array_as_text = array_as_text + ", '" + String(array[i]) + "']"
134136
else:
135-
array_as_text = array_as_text + ", " + String(array[i])
137+
array_as_text = array_as_text + ", '" + String(array[i]) + "'"
136138

137139
return array_as_text
138140

0 commit comments

Comments
 (0)