Return-Path: X-Original-To: apmail-groovy-dev-archive@minotaur.apache.org Delivered-To: apmail-groovy-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A11A21828F for ; Tue, 4 Aug 2015 17:58:30 +0000 (UTC) Received: (qmail 50439 invoked by uid 500); 4 Aug 2015 17:58:30 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 50394 invoked by uid 500); 4 Aug 2015 17:58:30 -0000 Mailing-List: contact dev-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.incubator.apache.org Delivered-To: mailing list dev@groovy.incubator.apache.org Received: (qmail 50384 invoked by uid 99); 4 Aug 2015 17:58:30 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2015 17:58:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CD81B1A974B for ; Tue, 4 Aug 2015 17:58:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-1.108, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id LEk86Xvknjmw for ; Tue, 4 Aug 2015 17:58:29 +0000 (UTC) Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id E000F428E4 for ; Tue, 4 Aug 2015 17:58:28 +0000 (UTC) Received: by qkdv3 with SMTP id v3so6140804qkd.3 for ; Tue, 04 Aug 2015 10:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=XwTQhaxmmmnZYxLNJsTqLCLOGzaWdRZqrWTkOgRJ45M=; b=JBFSqnCi+9VakE4U/oaS30rFCqbn+5FA/jiLmCWqactnRiX+JAyT3GHFCeOraMZMlZ zjnxgjiF54SecS/5wDuzfylcc2d9K/3xpW//ocXMyr8m+SMljXewFextehyw46aVAxzb m+pMLqRCzqzaWt/iTqqaA2Ie2mFwiK61RRU0KtNMWFCnkaI1yqar7TrpZOvH8bucYAgT 30aQlCd83xfq7Z0A9f14LIwfWadrrpEUKCAEmqzWN2WuybVf21qHdr/4bYfo7/TKMtsX 358DzTKv8ux2VNNAYZr6PQ9MMbYNvhssn7nFXvg6rOzievdqddcVtSKndIcw7TCLY5pU UG9A== X-Received: by 10.55.27.1 with SMTP id b1mr7528710qkb.39.1438711108393; Tue, 04 Aug 2015 10:58:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.97.9 with HTTP; Tue, 4 Aug 2015 10:58:09 -0700 (PDT) In-Reply-To: References: From: Keegan Witt Date: Tue, 4 Aug 2015 13:58:09 -0400 Message-ID: Subject: Re: JsonOutput and pretty print To: dev@groovy.incubator.apache.org Content-Type: multipart/alternative; boundary=001a1147e64c8ce2d2051c80082d --001a1147e64c8ce2d2051c80082d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Actually, thinking about this a little more, my suggestion would introduce an inconsistency for JsonOutput.prettyPrint(String). All the other prettyPrints would mean convert to JSON, then pretty print, but prettyPrint(String) would either assume the String is JSON, or have to include an extra parameter to communicate whether it is already JSON or not. If we were going to do this, your idea is actually better. -Keegan On Tue, Aug 4, 2015 at 1:05 PM, Keegan Witt wrote: > If I were to build JsonOutput from scratch today, I'd probably do as you > propose. But since we've already gone down the road of a separate method > for pretty printing, maybe it'd be more consistent to leave > JsonOutput.toJson() alone and instead add matching JsonOutput.prettyPrint= () > methods. What's everyone else think? > > -Keegan > > On Tue, Aug 4, 2015 at 2:21 AM, Esteban G=C3=ADnez wro= te: > >> JsonOutput > > > --001a1147e64c8ce2d2051c80082d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Actually, thinking about this a little more, my sugge= stion would introduce an inconsistency for JsonOutput.prettyPrint(String).= =C2=A0 All the other prettyPrints would mean convert to JSON, then pretty p= rint, but prettyPrint(String) would either assume the String is JSON, or ha= ve to include an extra parameter to communicate whether it is already JSON = or not.=C2=A0 If we were going to do this, your idea is actually better.
-Keegan


On Tue, Aug 4, 2015 at 1:05 PM, Keegan= Witt <keeganwitt@gmail.com> wrote:
If I were to buil= d JsonOutput from scratch today, I'd probably do as you propose.=C2=A0 = But since we've already gone down the road of a separate method for pre= tty printing, maybe it'd be more consistent to leave JsonOutput.toJson(= ) alone and instead add matching JsonOutput.prettyPrint() methods.=C2=A0 Wh= at's everyone else think?

-Keeg= an

On Tu= e, Aug 4, 2015 at 2:21 AM, Esteban G=C3=ADnez <eginez@gmail.com> wrote:
JsonOutput
<= br>

--001a1147e64c8ce2d2051c80082d--