Internet-Draft | JSON namespaces with dots for RPP | June 2025 |
Bortzmeyer | Expires 3 December 2025 | [Page] |
This document proposes a lightweight convention for namespaces in the JSON payloads of RPP: a registry of namespaces plus the convention to write JSON names as namespace_shortname. It is not intended to be published as a RFC, just to stir discussion.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 3 December 2025.¶
Copyright (c) 2025 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
In the current discussions about RPP (RESTful Provisioning Protocol, see [I-D.wullink-rpp-requirements]), there has been a lot of talk about the extensibility of the protocol (see section 13 of the above draft). One of the issues raised by this requirment of extensibility is the fact that JSON ([RFC8259]), unlike XML, has no concept of namespaces. In the JSON world, the common way to introduce new members in objects is for the receiver to ignore unknown members (section 7 of the above draft makes that a requirment, see the "strict vs. lenient" discussion). This allows future extensions but, for a provisioning protocol, it is annoying since it means that requests from the client will be partially and silently ignored. Also, the lack of namespaces can create collisions between two extensions using the same name.¶
As an example, if we have this payload describing a contact:¶
{ "name": "John Foobar", "date-of-birth": "2025-05-30", "country": "ZZ" }¶
What if we want to extend RPP to add the fact that John Foobar is a physical person, for instance for compliance with data privacy regulations that apply only to physical persons, like the GDPR?¶
{ "name": "John Foobar", "date-of-birth": "2025-05-30", "country": "ZZ", "is-a-physical-person": true }¶
How the "is-a-physical-person" member be marked and processed?¶
There have been a lot of proposals to add some form of namespaces in JSON, often as part as an effort to design a schema language for JSON. In the IETF world, see for instance JMAP ([RFC8620]), which uses URIs to indicate extensions. Another proposal was [I-D.saintandre-json-namespaces], using also URIs. But none has caught, in the sense of being widely recognized as a good way to create namespaces in JSON. There is an effort [I-D.ietf-regext-rdap-extensions],to add namespaces in RDAP, for extensibility, relying on a namespace_shortname syntax for member names.¶
For this document, the requirments are:¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Core names are not namespaced (at this stage, it is not decided if mappings for domains, contacts and hosts will be regarded as core, or as extensions).¶
Namespaces have to be registered with IANA, per Section 4.¶
The syntax follows ABNF ([RFC5234]). A namespace is identified by a string in restricted ASCII, just letters and dash:¶
namespace = %x2D / %x41-5A / %x61-7A¶
The name of a member of a JSON object in RPP will be "namespace_shortname":¶
name = [namespace %x5F] shortname¶
Presently, shortname is not defined in RPP but we can assume it will be a (may be restricted?) form of JSON strings. It MUST NOT include underscores.¶
{ "name": "John Foobar", "date-of-birth": "2025-05-30", "country": "ZZ", "physical-person_status": true }¶
Of course, this small proposal is far from a complete solution to extend RPP. Such a solution would need to include:¶
IANA is requested to create a registry of namespaces. These namespaces must conform to the syntax of Section 2.1. The policy to follow is "First Come First Served" as defined in Section 4.4 of [RFC8126]. (Alternative, "Specification Required", because it would be nice to have a specification but I understand that, currently, the actual semantics of "Specification Required" are not clear; for instance, is an Internet Draft sufficient?)¶
There is probably zero security consequences of this proposal.¶
To be deleted before publication?¶
The choice of the character used by a separator is not purely bike-shedding, since it may affect the use of protocols like JSONPath [RFC9535]. The use of dots, for instance, will make JSONPath expressions more complicated. So, the criteria for choosing a separator are:¶
Thanks to Andrew Newton about the choice of the separator.¶