From 0780fb12cef434ba0350b477429167e24f2fc445 Mon Sep 17 00:00:00 2001 From: Bernd Oberknapp Date: Sat, 11 Jul 2026 18:26:49 +0200 Subject: [PATCH] Return original instead of fixed JSON in public/api.php and demo/validate_api.php --- demo/validate_api.php | 2 +- public/api.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/validate_api.php b/demo/validate_api.php index 3c46cc7..f06e123 100644 --- a/demo/validate_api.php +++ b/demo/validate_api.php @@ -105,7 +105,7 @@ function print_result($response) $response->debug(); } if ($showJson) { - $json = $response->getJson(); + $json = json_decode($response->getJsonString()); if ($json !== null) { print("\n"); print(json_encode($json, JSON_PRETTY_PRINT)); diff --git a/public/api.php b/public/api.php index db47b58..a579518 100644 --- a/public/api.php +++ b/public/api.php @@ -130,8 +130,8 @@ function logApiSuccess(string $url, object $response, array $context = []): void } $file = null; -if ($response && method_exists($response, 'getJson')) { - $json_file = json_encode($response->getJson()); +if ($response instanceof \ubfr\c5tools\interfaces\JsonDocument) { + $json_file = $response->getJsonString(); if ($json_file) { $compressed = gzcompress($json_file, 3); if ($compressed) {