Internet-Draft JSON namespaces with dots for RPP June 2025
Bortzmeyer Expires 3 December 2025 [Page]
Workgroup:
Internet Engineering Task Force
Internet-Draft:
draft-bortzmeyer-rpp-json-dot-namespaces-01
Published:
Intended Status:
Informational
Expires:
Author:
S. Bortzmeyer
Afnic

Simple namespace-like proposal for JSON using a separator, for the RPP

Abstract

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.

Status of This Memo

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.

Table of Contents

1. Introduction

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:

1.1. Requirements Language

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.

2. The proposal

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.

2.1. Syntax

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.

2.2. Example

{
  "name": "John Foobar",
  "date-of-birth": "2025-05-30",
  "country": "ZZ",
  "physical-person_status": true
}

3. Towards a full extensibility proposal

Of course, this small proposal is far from a complete solution to extend RPP. Such a solution would need to include:

4. IANA Considerations

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?)

5. Security Considerations

There is probably zero security consequences of this proposal.

6. References

6.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC5234]
Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, , <https://www.rfc-editor.org/info/rfc5234>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, , <https://www.rfc-editor.org/info/rfc8126>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[RFC8259]
Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, , <https://www.rfc-editor.org/info/rfc8259>.

6.2. Informative References

[RFC8620]
Jenkins, N. and C. Newman, "The JSON Meta Application Protocol (JMAP)", RFC 8620, DOI 10.17487/RFC8620, , <https://www.rfc-editor.org/info/rfc8620>.
[RFC9535]
Gössner, S., Ed., Normington, G., Ed., and C. Bormann, Ed., "JSONPath: Query Expressions for JSON", RFC 9535, DOI 10.17487/RFC9535, , <https://www.rfc-editor.org/info/rfc9535>.
[I-D.ietf-regext-rdap-extensions]
Newton, A., Singh, J., and T. Harrison, "RDAP Extensions", Work in Progress, Internet-Draft, draft-ietf-regext-rdap-extensions-06, , <https://datatracker.ietf.org/doc/html/draft-ietf-regext-rdap-extensions-06>.
Wullink, M. and P. Kowalik, "RESTful Provisioning Protocol (RPP) - Requirements", Work in Progress, Internet-Draft, draft-wullink-rpp-requirements-01, , <https://datatracker.ietf.org/doc/html/draft-wullink-rpp-requirements-01>.
[I-D.saintandre-json-namespaces]
Hildebrand, J., Miller, M. A., and P. Saint-Andre, "JavaScript Object Notation (JSON) Namespaces", Work in Progress, Internet-Draft, draft-saintandre-json-namespaces-00, , <https://datatracker.ietf.org/doc/html/draft-saintandre-json-namespaces-00>.

Appendix A. Discussions and alternatives

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:

Appendix B. Acknowledgments

Thanks to Andrew Newton about the choice of the separator.

Author's Address

Stéphane Bortzmeyer
Afnic
7 avenue du 8 mai 1945
78280 Guyancourt
France