Re: [netconf] restconf collections

Kent Watsen <> Thu, 29 October 2020 16:05 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5211B3A083F for <>; Thu, 29 Oct 2020 09:05:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id cIqykY3wU6ee for <>; Thu, 29 Oct 2020 09:05:14 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 62E763A07BD for <>; Thu, 29 Oct 2020 09:05:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono;; t=1603987513; h=Content-Type:Content-Transfer-Encoding:From:Mime-Version:Subject:Date:Message-Id:References:Cc:In-Reply-To:To:Feedback-ID; bh=a6ZCE0AZ9w88Sj0lgKHy2sUTpfcC58fse5bWnakJAiY=; b=YsS4XbPU7t9bRWLVFsykDZUh2Em7v9CyoGjR86ovgNyON92s082ZqPInivq57h3U 1DdLSuOvXZ3dCurGjmaATov13g5l2CzT5kd4UlXYdtMY2aQf+z/q5ugYe/d+AKcO4na U28IYV1QgEa74H9KPwpGAjYsdJqK6KBpGvZ7ecFY=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
From: Kent Watsen <>
Mime-Version: 1.0 (1.0)
Date: Thu, 29 Oct 2020 16:05:13 +0000
Message-ID: <>
References: <>
In-Reply-To: <>
To: Martin Björklund <>
X-Mailer: iPhone Mail (18A393)
X-SES-Outgoing: 2020.10.29-
Archived-At: <>
Subject: Re: [netconf] restconf collections
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 29 Oct 2020 16:05:15 -0000

Hi Martin,

> This is not a good proposal, since the result is not a valid XML
> document.  

How is this important?  It’s not an HTTP-constraint, right?  and I don’t think it is needed for message-framing either.   

I guess, as you mention below, the media-type is inappropriate (though 11.3.1 isn’t as clear as one might hope), so maybe the response is okay if only changing the media type?

> An XML document has exactly one root element.
> Also, the media types used in the examples are misleading.  The
> example reply doesn't match the media type
> "application/yang-data+json" (same for xml).

How isn’t the media-type okay for JSON, for the response in the previous message?  It seems valid to me...

No dispute regarding the XML media-type.  

> I suggest you define new media types and a "collection" root
> element; or keep the media types and define "collection" in a YANG
> module as:
>  anydata collection;

Noted, but first would like to understand why simply changing the media-type alone (while keeping the responses in the previous message) isn’t sufficient, for both xml and json. 

Each media-type can define its own format so, e.g., “application/yang-data+xml-list" could be used to define a list of XML documents, right?

That said, I acknowledge that having a root-element may aid xml-parsers, and thus perhaps worthwhile for that reason...just want to ensure we understand the motivations accurately.