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
This commit is contained in:
mountford 2018-05-16 10:08:27 -07:00 committed by jianglai
parent c7ca0ea2aa
commit 36439d02b3

View file

@ -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 dont think that one street address line nested in a single-element array is valid
// according to RFC 7095.
ImmutableList<String> street = address.getStreet();
if (street.isEmpty()) {
jsonBuilder.add("");