Re: [Json] sourcecode type="json"

Pete Cordell <petejson@codalogic.com> Tue, 26 October 2021 20:19 UTC

Return-Path: <petejson@codalogic.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C4F0F3A12F7 for <json@ietfa.amsl.com>; Tue, 26 Oct 2021 13:19:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.23
X-Spam-Level:
X-Spam-Status: No, score=-5.23 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-3.33, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V8NoR5ix9L4e for <json@ietfa.amsl.com>; Tue, 26 Oct 2021 13:19:02 -0700 (PDT)
Received: from ppsa-online.com (ppsa-online.com [217.199.162.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C4B73A11B7 for <json@ietf.org>; Tue, 26 Oct 2021 13:19:00 -0700 (PDT)
Received: (qmail 17632 invoked from network); 26 Oct 2021 21:18:58 +0100
Received: from host86-140-57-185.range86-140.btcentralplus.com (HELO ?192.168.1.72?) (86.140.57.185) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPS (TLS_AES_128_GCM_SHA256 encrypted, authenticated); 26 Oct 2021 20:18:58 -0000
To: Carsten Bormann <cabo@tzi.org>, json@ietf.org, rfc-interest <rfc-interest@rfc-editor.org>
Cc: asdf@ietf.org
References: <13AB383A-D467-400F-B48D-A0EC6B6D82AA@tzi.org>
From: Pete Cordell <petejson@codalogic.com>
Message-ID: <eaa076b0-7782-dbbe-628c-8aa7c5588d6c@codalogic.com>
Date: Tue, 26 Oct 2021 21:18:58 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0
MIME-Version: 1.0
In-Reply-To: <13AB383A-D467-400F-B48D-A0EC6B6D82AA@tzi.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-GB
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/byzA3Z7wuoP66phwsYDBfYItJc4>
Subject: Re: [Json] sourcecode type="json"
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Oct 2021 20:19:08 -0000

On 26/10/2021 20:26, Carsten Bormann wrote:
> https://www.ietf.org/archive/id/draft-ietf-asdf-sdf-08.html
> 
> includes a number of JSON examples, or at least it claims so.
> 
> We created 15 examples that are marked »<sourcecode type=“json”>«.  Of these, 3 are JSON, and 12 are a single member (or two) without surrounding braces, meant to be put into larger JSON objects.
> 
> E.g.:
> https://www.ietf.org/archive/id/draft-ietf-asdf-sdf-08.html#section-3.2-6
> 
> These braces can of course be added, but they are really noise distracting from the content that is in these members (and the objects formed this way may be valid JSON, but they usually aren’t valid SDF).
> 
> Should we introduce a new sourcecode type “json-members”?
> Or should we bite the bullet and add the noise to get real JSON texts?

For a fragment of something bigger in free-form text I'd add ellipsis 
either side, e.g.:

    ...
    "namespace": {
      "cap": "https://example.com/capability/cap",
      "zcl": "https://zcl.example.com/sdf"
    },
    "defaultNamespace": "cap",
    ...

Is there not a precedent using things other than JSON (such as code 
samples) that offers guidance on whether to keep with a type="json" or 
add a new type?

HTH,

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------