From 5351d13a5d3dc189dfc04e08ce4cf4af89faa8fa Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 3 Oct 2022 04:08:46 +0700 Subject: [PATCH] Fix JSONAPI not parsing JSON values padded with spaces JSONAPI couldn't parse JSON values like " {"key": :value"}" because of the spaces before the opening curly brace. This behaviour was judged to be unintuitive and a bug. This patch fixes the issue by always skipping spaces in front of the value. This should not break parsing JSON string values, since they are supposed to start with double quotation mark. --- sources/Text/JSON/JSONAPI.uc | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/Text/JSON/JSONAPI.uc b/sources/Text/JSON/JSONAPI.uc index b710a3b..9caf7f8 100644 --- a/sources/Text/JSON/JSONAPI.uc +++ b/sources/Text/JSON/JSONAPI.uc @@ -821,6 +821,7 @@ public final function AcediaObject ParseWith( if (parser == none) return none; if (!parser.Ok()) return none; + parser.Skip(); initState = parser.GetCurrentState(); TryNullWith(parser); if (parser.Ok()) {