Architecture: ApiClient autoload (HTTP + JWT + error contract) #29

Merged
reviewer-bot merged 7 commits from agent/5b3da417b50c into main 2026-08-19 15:45:01 +00:00
Showing only changes of commit 33c5236a2d - Show all commits
+5 -4
View File
@@ -172,16 +172,17 @@ func _on_http_request_completed(
var detail: String = ""
if response_code >= 200 and response_code < 300:
# Success — try to parse JSON.
# Success — try to parse JSON (works for both objects and arrays).
var parse_result = JSON.parse_string(json_string)
if parse_result is Dictionary:
if parse_result is Dictionary or parse_result is Array:
data = parse_result
# Extract backend detail if present.
if data.has("detail"):
# Extract backend detail if present (e.g. {"ok": true, "detail": "OK"}).
if data is Dictionary and data.has("detail"):
detail = str(data["detail"])
else:
detail = "OK"
else:
# Not valid JSON — return raw string.
data = json_string
detail = "OK"
else: