From 36439d02b329e886cb25ee6ae6514af0ac0d4d0b Mon Sep 17 00:00:00 2001 From: mountford Date: Wed, 16 May 2018 10:08:27 -0700 Subject: [PATCH] RDAP: Add clarification about formatting of embedded vCard addresses Gustavo Lozano confirmed that street addresses should be formatted as a string if there is only one line, or an nested array of strings if there is more than one. Luckily we already do it this way, so we just need to update the comment. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=196845222 --- java/google/registry/rdap/RdapJsonFormatter.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java/google/registry/rdap/RdapJsonFormatter.java b/java/google/registry/rdap/RdapJsonFormatter.java index bb7256d66..e1e6a4b64 100644 --- a/java/google/registry/rdap/RdapJsonFormatter.java +++ b/java/google/registry/rdap/RdapJsonFormatter.java @@ -1096,6 +1096,16 @@ public class RdapJsonFormatter { // "Hometown", "PA", "18252", "U.S.A." // ] // ] + // + // Gustavo further clarified that the embedded array should only be used if there is more than + // one line: + // + // My reading of RFC 7095 is that if only one element is known, it must be a string. If + // multiple elements are known (e.g. two or three street elements were provided in the case of + // the EPP contact data model), an array must be used. + // + // I don’t think that one street address line nested in a single-element array is valid + // according to RFC 7095. ImmutableList street = address.getStreet(); if (street.isEmpty()) { jsonBuilder.add("");