From dev-return-84988-archive-asf-public=cust-asf.ponee.io@sling.apache.org Thu Jan 4 09:02:26 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 1C4C6180657 for ; Thu, 4 Jan 2018 09:02:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0C8F2160C2B; Thu, 4 Jan 2018 08:02:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4940D160C28 for ; Thu, 4 Jan 2018 09:02:25 +0100 (CET) Received: (qmail 1603 invoked by uid 500); 4 Jan 2018 08:02:24 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 1592 invoked by uid 99); 4 Jan 2018 08:02:24 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jan 2018 08:02:24 +0000 From: GitBox To: dev@sling.apache.org Subject: [GitHub] bhardwajrahul20 commented on a change in pull request #1: Sling-7346-Json response converting response property value to string even if it is json object Message-ID: <151505294362.24256.13573326618493046064.gitbox@gitbox.apache.org> bhardwajrahul20 commented on a change in pull request #1: Sling-7346-Json response converting response property value to string even if it is json object URL: https://github.com/apache/sling-org-apache-sling-servlets-post/pull/1#discussion_r159595820 ########## File path: src/main/java/org/apache/sling/servlets/post/JSONResponse.java ########## @@ -103,9 +104,13 @@ JsonObject getJson() { JsonObjectBuilder jsonBuilder = Json.createObjectBuilder(); for (Map.Entry entry : json.entrySet()) { if (entry.getValue() != null) { - jsonBuilder.add(entry.getKey(), entry.getValue().toString()); - } - else { + try { Review comment: @kwin - That's difficult because the class type of entry value can't be restricted to a range. We can't really exhaustively give all the possible json class names. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services