From 1511aa88265f1716f6a59c76bca98d844b09ed5a Mon Sep 17 00:00:00 2001 From: Kumar Abhishek Date: Mon, 27 Apr 2026 16:51:55 -0700 Subject: [PATCH] fix(serde): handle raw % in README CSS without crashing export URLDecoder.decode() throws IllegalArgumentException when a README description contains raw % characters from inline CSS (e.g. width:100%;). AssetDeserializer calls decodeContent() for every Readme asset during deserialization, so a single malformed README aborts the entire export. Catch IllegalArgumentException and fall back to the raw value. Content that was never URL-encoded is already in its correct form, so this is safe. Valid URL-encoded sequences (%XX) are unaffected. Fixes export failures on tenants where READMEs were saved with inline table styles via the rich-text editor. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Kumar Abhishek --- sdk/src/main/java/com/atlan/util/StringUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/src/main/java/com/atlan/util/StringUtils.java b/sdk/src/main/java/com/atlan/util/StringUtils.java index df74c65161..36ef0c73c1 100644 --- a/sdk/src/main/java/com/atlan/util/StringUtils.java +++ b/sdk/src/main/java/com/atlan/util/StringUtils.java @@ -93,7 +93,14 @@ public static String encodeContent(String decoded) { * @return decoded README content (HTML) */ public static String decodeContent(String encoded) { - return encoded == null ? null : URLDecoder.decode(encoded.replace("%20", "+"), StandardCharsets.UTF_8); + if (encoded == null) return null; + try { + return URLDecoder.decode(encoded.replace("%20", "+"), StandardCharsets.UTF_8); + } catch (IllegalArgumentException e) { + // README content may contain raw % in CSS (e.g. width:100%;) that was never + // URL-encoded — return as-is rather than crashing the entire export + return encoded; + } } /**