]> Sergey Matveev's repositories - public-inbox.git/commit
address: pairs: new helper for JMAP (and maybe lei)
authorEric Wong <e@80x24.org>
Tue, 5 Jan 2021 09:04:37 +0000 (09:04 +0000)
committerEric Wong <e@80x24.org>
Wed, 6 Jan 2021 10:45:09 +0000 (10:45 +0000)
commit348e7a39627fd40d7cc0ca1be01412da51a71352
tree00af1f86f9aa4cb935f4d6638217b2a8ea97b1ac
parent27f8e2b161f4a8bb1ef030bd45e3f5ae7a9f0bb0
address: pairs: new helper for JMAP (and maybe lei)

Per JMAP RFC 8621 sec 4.1.2.3, we should be able to
denote the lack of a phrase/comment corresponding to an
email address with a JSON "null" (or Perl `undef').

  [
    { "name": "James Smythe", "email": "james@example.com" },
    { "name": null, "email": "jane@example.com" },
    { "name": "John Smith", "email": "john@example.com" }
  ]

The new "pairs" method just returns a 2 dimensional array
and the consumer will fill in the field names if necessary
(or not).

lei(1) may use the two dimensional array as-is for JSON output.
lib/PublicInbox/Address.pm
lib/PublicInbox/AddressPP.pm
t/address.t