You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by hq...@apache.org on 2026/10/23 06:55:26 UTC
(james-project) branch master updated: JAMES-4236: Return null for requested nullable JMAP properties (#3263)
This is an automated email from the ASF dual-hosted git repository.
quantranhong1999 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new 688c49428b JAMES-4236: Return null for requested nullable JMAP properties (#3263)
688c49428b is described below
commit 688c49428bb7f62f448abb61a3a2bec2bc8289a0
Author: Chi Lan Nguyen <14...@users.noreply.github.com>
AuthorDate: Fri Oct 23 13:55:20 2026 +0700
JAMES-4236: Return null for requested nullable JMAP properties (#3263)
---
.../rfc8621/contract/EmailGetMethodContract.scala | 92 +++++++++++++++++++---
.../rfc8621/contract/EmailImportContract.scala | 4 +
.../contract/EmailParseMethodContract.scala | 15 ++++
.../rfc8621/contract/EmailSetMethodContract.scala | 65 +++++++++++++--
.../rfc8621/contract/IdentityGetContract.scala | 13 +++
.../rfc8621/contract/IdentitySetContract.scala | 2 +
.../contract/MailboxChangesMethodContract.scala | 2 +
.../contract/MailboxGetMethodContract.scala | 6 ++
.../contract/MailboxSetMethodContract.scala | 5 ++
.../PushSubscriptionSetMethodContract.scala | 10 ++-
.../rfc8621/contract/QuotaGetMethodContract.scala | 20 ++++-
.../VacationResponseGetMethodContract.scala | 3 +
.../james/jmap/json/EmailGetSerializer.scala | 20 ++---
.../james/jmap/json/IdentitySerializer.scala | 6 +-
.../apache/james/jmap/json/MailboxSerializer.scala | 2 +-
.../jmap/json/PushSubscriptionSerializer.scala | 2 +-
.../apache/james/jmap/json/QuotaSerializer.scala | 2 +-
.../james/jmap/json/VacationSerializer.scala | 2 +-
.../scala/org/apache/james/jmap/json/package.scala | 2 +
.../james/jmap/json/QuotaSerializerTest.scala | 12 +++
20 files changed, 247 insertions(+), 38 deletions(-)
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
index 0823a95a44..2ead6198f1 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
@@ -564,6 +564,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -617,6 +618,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "to": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1028,6 +1030,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "from": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1081,6 +1084,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "cc": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1134,6 +1138,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "bcc": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1186,6 +1191,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "sender": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1239,6 +1245,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "replyTo": [
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1333,7 +1340,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "to": null
|}""".stripMargin)
}
@@ -1386,6 +1394,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1432,7 +1441,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "cc": null
|}""".stripMargin)
}
@@ -1485,6 +1495,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1531,7 +1542,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "bcc": null
|}""".stripMargin)
}
@@ -1584,6 +1596,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1630,7 +1643,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "from": null
|}""".stripMargin)
}
@@ -1683,6 +1697,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
| ]
@@ -1729,7 +1744,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "replyTo": null
|}""".stripMargin)
}
@@ -1817,7 +1833,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "subject": null
|}""".stripMargin)
}
@@ -1957,7 +1974,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "sentAt": null
|}""".stripMargin)
}
@@ -2058,6 +2076,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "sender": [
| {
+ | "name": null,
| "email": "user1@domain.tld"
| }
| ]
@@ -2113,6 +2132,7 @@ trait EmailGetMethodContract {
| "email": "user1@domain.tld"
| },
| {
+ | "name": null,
| "email": "user2@domain.tld"
| }
|
@@ -2160,7 +2180,8 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0]")
.isEqualTo(
s"""{
- | "id": "${messageId.serialize}"
+ | "id": "${messageId.serialize}",
+ | "sender": null
|}""".stripMargin)
}
@@ -2483,9 +2504,10 @@ trait EmailGetMethodContract {
| "messageId": ["13d4375e-a4a9-f613-06a1-7e8cb1e0ea93@linagora.com"],
| "from": [{"name": "Lina","email": "from@linagora.com"}],
| "sentAt": "2017-02-27T04:24:48Z",
- | "to": [{"email": "to@linagora.com"}],
+ | "to": [{"name": null, "email": "to@linagora.com"}],
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "2",
| "blobId": "${messageId.serialize}_2",
| "size": 8,
@@ -2495,6 +2517,7 @@ trait EmailGetMethodContract {
| ],
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "3",
| "blobId": "${messageId.serialize}_3",
| "size": 271,
@@ -2504,6 +2527,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "4",
| "blobId": "${messageId.serialize}_4",
| "size": 398,
@@ -2513,6 +2537,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "size": 412,
@@ -2524,6 +2549,7 @@ trait EmailGetMethodContract {
| ],
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "2",
| "blobId": "${messageId.serialize}_2",
| "size": 8,
@@ -2533,6 +2559,7 @@ trait EmailGetMethodContract {
| ],
| "bodyValues": {},
| "preview": "Send",
+ | "bcc": null, "cc": null, "replyTo": null, "sender": null,
| "hasAttachment": true
| }
| ],
@@ -2585,6 +2612,7 @@ trait EmailGetMethodContract {
| "inReplyTo": null,
| "to": [
| {
+ | "name": null,
| "email": "magiclan@linagora.com"
| }
| ],
@@ -2599,6 +2627,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize()}",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 42,
| "partId": "2",
@@ -2606,6 +2635,7 @@ trait EmailGetMethodContract {
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 108,
| "partId": "3",
@@ -2622,12 +2652,14 @@ trait EmailGetMethodContract {
| ],
| "from": [
| {
+ | "name": null,
| "email": "tungexplorer@linagora.com"
| }
| ],
| "keywords": {},
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 42,
| "partId": "2",
@@ -2635,6 +2667,7 @@ trait EmailGetMethodContract {
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 108,
| "partId": "3",
@@ -2643,6 +2676,7 @@ trait EmailGetMethodContract {
| }
| ],
| "threadId": "${messageId.serialize()}",
+ | "bcc": null, "cc": null, "replyTo": null, "sender": null,
| "hasAttachment": false
|}""".stripMargin)
}
@@ -3388,6 +3422,7 @@ trait EmailGetMethodContract {
.inPath("methodResponses[0][1].list[0].bodyStructure")
.isEqualTo(
s"""{
+ | "blobId": null,
| "subParts": [
| {
| "size": 0,
@@ -3649,6 +3684,7 @@ trait EmailGetMethodContract {
| {
| "id": "${messageId.serialize}",
| "bodyStructure": {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "1",
| "blobId": "${messageId.serialize}_1",
| "size": 8,
@@ -3841,6 +3877,7 @@ trait EmailGetMethodContract {
| {
| "id": "${messageId.serialize}",
| "bodyStructure": {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "1",
| "blobId": "${messageId.serialize}_1",
| "headers": [
@@ -3920,6 +3957,7 @@ trait EmailGetMethodContract {
s"""{
| "id": "${messageId.serialize}",
| "bodyStructure": {
+ | "cid": null, "disposition": null, "name": null,
| "header:Subject:asText": "test",
| "charset": "UTF-8",
| "size": 8,
@@ -4021,10 +4059,12 @@ trait EmailGetMethodContract {
| }
| ],
| "size": 1880,
+ | "blobId": null, "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "type": "multipart/mixed",
| "charset": "US-ASCII",
| "subParts": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "2",
| "blobId": "${messageId.serialize}_2",
| "headers": [
@@ -4042,6 +4082,7 @@ trait EmailGetMethodContract {
| "charset": "UTF-8"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "3",
| "blobId": "${messageId.serialize}_3",
| "headers": [
@@ -4065,6 +4106,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "4",
| "blobId": "${messageId.serialize}_4",
| "headers": [
@@ -4088,6 +4130,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "headers": [
@@ -4216,6 +4259,7 @@ trait EmailGetMethodContract {
| }
| ],
| "size": 891,
+ | "blobId": null, "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "type": "multipart/mixed",
| "charset": "US-ASCII",
| "subParts": [
@@ -4228,10 +4272,13 @@ trait EmailGetMethodContract {
| }
| ],
| "size": 398,
+ | "blobId": null, "cid": null, "disposition": null, "language": null, "location": null,
+ | "name": null,
| "type": "multipart/alternative",
| "charset": "US-ASCII",
| "subParts": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "3",
| "blobId": "${messageId.serialize}_3",
| "headers": [
@@ -4249,6 +4296,7 @@ trait EmailGetMethodContract {
| "charset": "ISO-8859-1"
| },
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "4",
| "blobId": "${messageId.serialize}_4",
| "headers": [
@@ -4268,6 +4316,7 @@ trait EmailGetMethodContract {
| ]
| },
| {
+ | "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "headers": [
@@ -4356,6 +4405,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "2",
| "blobId": "${messageId.serialize}_2",
| "size": 8,
@@ -4421,6 +4471,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "3",
| "blobId": "${messageId.serialize}_3",
| "size": 20,
@@ -4428,6 +4479,7 @@ trait EmailGetMethodContract {
| "charset": "ISO-8859-1"
| },
| {
+ | "language": null, "location": null,
| "charset": "ISO-8859-1",
| "disposition": "inline",
| "size": 19,
@@ -4496,6 +4548,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "4",
| "blobId": "${messageId.serialize}_4",
| "size": 30,
@@ -4503,6 +4556,7 @@ trait EmailGetMethodContract {
| "charset": "ISO-8859-1"
| },
| {
+ | "language": null, "location": null,
| "charset": "ISO-8859-1",
| "disposition": "inline",
| "size": 19,
@@ -4772,6 +4826,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -4781,6 +4836,7 @@ trait EmailGetMethodContract {
| "name":"yyy.txt"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -4874,6 +4930,7 @@ trait EmailGetMethodContract {
| "accountId": "$bobAccountId",
| "notFound": [],
| "list": [{
+ | "bcc": null, "cc": null, "replyTo": null,
| "preview": "Main test message...",
| "to": [{
| "name": "Alice",
@@ -4894,6 +4951,7 @@ trait EmailGetMethodContract {
| "sentAt": "$${json-unit.ignore}",
| "hasAttachment": true,
| "attachments": [{
+ | "cid": null, "language": null, "location": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -4903,6 +4961,7 @@ trait EmailGetMethodContract {
| "type": "application/json"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -4991,6 +5050,7 @@ trait EmailGetMethodContract {
| "state": "33ac468f-7903-4f68-ac3e-8120505b5c3d",
| "list": [
| {
+ | "bcc": null, "cc": null, "replyTo": null,
| "id": "${messageId.serialize}",
| "keywords": {},
| "mailboxIds": {
@@ -5014,6 +5074,7 @@ trait EmailGetMethodContract {
| "sentAt": "$${json-unit.ignore}",
| "attachments": [
| {
+ | "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "size": 4334,
@@ -5124,8 +5185,10 @@ trait EmailGetMethodContract {
| },
| "receivedAt": "$${json-unit.ignore}",
| "sentAt": "$${json-unit.ignore}",
+ | "bcc": null, "cc": null, "replyTo": null,
| "hasAttachment": true,
| "attachments": [{
+ | "cid": null,
| "charset": "US-ASCII",
| "headers": [{
| "name": "Content-Type",
@@ -5148,6 +5211,7 @@ trait EmailGetMethodContract {
| "type": "application/json"
| },
| {
+ | "cid": null,
| "charset": "US-ASCII",
| "headers": [{
| "name": "Content-Type",
@@ -5252,6 +5316,7 @@ trait EmailGetMethodContract {
| "accountId": "$bobAccountId",
| "notFound": [],
| "list": [{
+ | "bcc": null, "cc": null, "replyTo": null,
| "preview": "Main test message...",
| "to": [{
| "name": "Alice",
@@ -5272,6 +5337,7 @@ trait EmailGetMethodContract {
| "sentAt": "$${json-unit.ignore}",
| "hasAttachment": true,
| "attachments": [{
+ | "cid": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -5279,6 +5345,7 @@ trait EmailGetMethodContract {
| "type": "application/json"
| },
| {
+ | "cid": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 102,
@@ -5639,6 +5706,7 @@ trait EmailGetMethodContract {
.isEqualTo(
s"""{
| "htmlBody": [{
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 47,
| "partId": "3",
@@ -6193,6 +6261,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "3",
| "blobId": "${messageId.serialize}_3",
| "size": 271,
@@ -6202,6 +6271,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "4",
| "blobId": "${messageId.serialize}_4",
| "size": 398,
@@ -6211,6 +6281,7 @@ trait EmailGetMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "size": 412,
@@ -6278,6 +6349,7 @@ trait EmailGetMethodContract {
| "id": "${messageId.serialize}",
| "attachments": [
| {
+ | "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize}_5",
| "size": 19,
@@ -7745,6 +7817,7 @@ trait EmailGetMethodContract {
| "name": "Friends",
| "addresses": [
| {
+ | "name": null,
| "email": "user3@domain.tld"
| },
| {
@@ -7818,6 +7891,7 @@ trait EmailGetMethodContract {
| "email": "user2@domain.tld"
| },
| {
+ | "name": null,
| "email": "user3@domain.tld"
| },
| {
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
index f7555cdb86..45c8b62edd 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
@@ -269,6 +269,7 @@ trait EmailImportContract {
| "id": "$messageId",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
@@ -394,6 +395,7 @@ trait EmailImportContract {
| "id": "$messageId",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
@@ -516,6 +518,7 @@ trait EmailImportContract {
| "id": "$messageId",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
@@ -636,6 +639,7 @@ trait EmailImportContract {
| "id": "$messageId",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailParseMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailParseMethodContract.scala
index 03c21623fb..fc416e780e 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailParseMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailParseMethodContract.scala
@@ -125,15 +125,18 @@ trait EmailParseMethodContract {
| "accountId": "$bobAccountId",
| "parsed": {
| "${messageId.serialize()}": {
+ | "bcc": null, "cc": null, "replyTo": null, "sender": null,
| "inReplyTo": null,
| "to": [
| {
+ | "name": null,
| "email": "to@linagora.com"
| }
| ],
| "references": null,
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
@@ -145,6 +148,7 @@ trait EmailParseMethodContract {
| "hasAttachment": true,
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "UTF-8",
| "disposition": "attachment",
| "size": 271,
@@ -154,6 +158,7 @@ trait EmailParseMethodContract {
| "type": "text/plain"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "US-ASCII",
| "disposition": "attachment",
| "size": 398,
@@ -163,6 +168,7 @@ trait EmailParseMethodContract {
| "type": "application/vnd.ms-publisher"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "charset": "UTF-8",
| "disposition": "attachment",
| "size": 412,
@@ -178,6 +184,7 @@ trait EmailParseMethodContract {
| "preview": "Send concerted from html",
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "size": 39,
| "partId": "2",
@@ -342,6 +349,7 @@ trait EmailParseMethodContract {
| "hasAttachment": true,
| "attachments": [
| {
+ | "cid": null,
| "partId": "3",
| "blobId": "${messageId.serialize()}_3_3",
| "size": 16,
@@ -474,6 +482,7 @@ trait EmailParseMethodContract {
| "sentAt": "2017-02-27T04:24:48Z",
| "to": [
| {
+ | "name": null,
| "email": "to@linagora.com"
| }
| ]
@@ -598,6 +607,7 @@ trait EmailParseMethodContract {
| "hasAttachment": true,
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "3",
| "blobId": "${messageId.serialize()}_3",
| "headers": [
@@ -621,6 +631,7 @@ trait EmailParseMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "4",
| "blobId": "${messageId.serialize()}_4",
| "headers": [
@@ -644,6 +655,7 @@ trait EmailParseMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null, "language": null, "location": null,
| "partId": "5",
| "blobId": "${messageId.serialize()}_5",
| "headers": [
@@ -733,6 +745,7 @@ trait EmailParseMethodContract {
| "hasAttachment": true,
| "attachments": [
| {
+ | "cid": null,
| "partId": "3",
| "blobId": "${messageId.serialize()}_3",
| "size": 271,
@@ -742,6 +755,7 @@ trait EmailParseMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null,
| "partId": "4",
| "blobId": "${messageId.serialize()}_4",
| "size": 398,
@@ -751,6 +765,7 @@ trait EmailParseMethodContract {
| "disposition": "attachment"
| },
| {
+ | "cid": null,
| "partId": "5",
| "blobId": "${messageId.serialize()}_5",
| "size": 412,
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
index 481388ade2..b958209169 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
@@ -193,10 +193,10 @@ trait EmailSetMethodContract {
""""header:aheader:asText:all": ["abc"]""",
""""header:aheader:asText:all": ["abc", "def"]""",
""""header:aheader:asDate": "2020-10-29T06:39:04Z"""",
- """"header:aheader:asAddresses": [{"email": "rcpt1@apache.org"}, {"email": "rcpt2@apache.org"}]""",
+ """"header:aheader:asAddresses": [{"name": null, "email": "rcpt1@apache.org"}, {"name": null, "email": "rcpt2@apache.org"}]""",
""""header:aheader:asURLs": ["url1", "url2"]""",
""""header:aheader:asMessageIds": ["id1@domain.tld", "id2@domain.tld"]""",
- """"header:aheader:asGroupedAddresses": [{"name": null,"addresses": [{"name": "user1","email": "user1@domain.tld" },{"name": "user2", "email": "user2@domain.tld"}]},{"name": "Friends","addresses": [{"email": "user3@domain.tld"},{"name": "user4","email": "user4@domain.tld"}]}]"""
+ """"header:aheader:asGroupedAddresses": [{"name": null,"addresses": [{"name": "user1","email": "user1@domain.tld" },{"name": "user2", "email": "user2@domain.tld"}]},{"name": "Friends","addresses": [{"name": null, "email": "user3@domain.tld"},{"name": "user4","email": "user4@domain.tld"}]}]"""
))
def createShouldPositionSpecificHeaders(specificHeader: String, server: GuiceJamesServer): Unit = {
val bobPath = MailboxPath.inbox(bobUsername)
@@ -964,11 +964,11 @@ trait EmailSetMethodContract {
.inPath(s"methodResponses[1][1].list")
.isEqualTo(s"""[{
| "cc": [{"name": "MODALİF", "email": "modalif@domain.tld"}],
- | "bcc": [{"email": "benwa@apache.org"}],
- | "to": [{"email": "rcpt1@apache.org"}, {"email": "rcpt2@apache.org"}],
- | "from": [{"email": "rcpt2@apache.org"}, {"email": "rcpt3@apache.org"}],
- | "sender": [{"email": "rcpt4@apache.org"}],
- | "replyTo": [{"email": "rcpt6@apache.org"}, {"email": "rcpt7@apache.org"}]
+ | "bcc": [{"name": null, "email": "benwa@apache.org"}],
+ | "to": [{"name": null, "email": "rcpt1@apache.org"}, {"name": null, "email": "rcpt2@apache.org"}],
+ | "from": [{"name": null, "email": "rcpt2@apache.org"}, {"name": null, "email": "rcpt3@apache.org"}],
+ | "sender": [{"name": null, "email": "rcpt4@apache.org"}],
+ | "replyTo": [{"name": null, "email": "rcpt6@apache.org"}, {"name": null, "email": "rcpt7@apache.org"}]
|}]""".stripMargin)
}
@@ -1038,7 +1038,7 @@ trait EmailSetMethodContract {
.whenIgnoringPaths("methodResponses[1][1].list[0].id")
.inPath(s"methodResponses[1][1].list")
.isEqualTo(s"""[{
- | "sender": [{"email": "rcpt4@apache.org"}, {"email": "rcpt3@apache.org"}]
+ | "sender": [{"name": null, "email": "rcpt4@apache.org"}, {"name": null, "email": "rcpt3@apache.org"}]
|}]""".stripMargin)
}
@@ -2529,6 +2529,7 @@ trait EmailSetMethodContract {
| "subject": "World domination",
| "attachments": [
| {
+ | "cid": null, "name": null,
| "partId": "4",
| "blobId": "${messageId}_4",
| "size": 11,
@@ -2658,6 +2659,7 @@ trait EmailSetMethodContract {
| "subject": "World domination",
| "attachments": [
| {
+ | "cid": null, "name": null,
| "partId": "4",
| "blobId": "${messageId}_4",
| "size": 11,
@@ -2867,6 +2869,7 @@ trait EmailSetMethodContract {
| "subject": "World domination",
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null, "name": null,
| "partId": "5",
| "blobId": "${messageId}_5",
| "size": 11,
@@ -2877,6 +2880,7 @@ trait EmailSetMethodContract {
| ],
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "4",
| "blobId": "${messageId}_4",
| "size": 166,
@@ -3009,6 +3013,7 @@ trait EmailSetMethodContract {
| "subject": "World domination",
| "attachments": [
| {
+ | "cid": null, "language": null, "location": null, "name": null,
| "partId": "4",
| "blobId": "${messageId}_4",
| "size": 11,
@@ -3019,6 +3024,7 @@ trait EmailSetMethodContract {
| ],
| "textBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "3",
| "blobId": "${messageId}_3",
| "size": 29,
@@ -3102,6 +3108,7 @@ trait EmailSetMethodContract {
jsonEquals(
s"""[
| {
+ | "name": null, "disposition": null, "cid": null, "language": null, "location": null,
| "partId": "$${json-unit.ignore}",
| "blobId": "$${json-unit.ignore}",
| "size": ${payload.size},
@@ -3175,6 +3182,7 @@ trait EmailSetMethodContract {
jsonEquals(
s"""[
| {
+ | "name": null, "disposition": null, "cid": null, "language": null, "location": null,
| "partId": "$${json-unit.ignore}",
| "blobId": "$${json-unit.ignore}",
| "size": 166,
@@ -3779,6 +3787,7 @@ trait EmailSetMethodContract {
| "subject": "World domination",
| "attachments": [
| {
+ | "language": null, "location": null, "name": null,
| "partId": "6",
| "blobId": "${messageId}_6",
| "size": 11,
@@ -3788,6 +3797,7 @@ trait EmailSetMethodContract {
| "cid": "abc"
| },
| {
+ | "language": null, "location": null, "name": null,
| "partId": "7",
| "blobId": "${messageId}_7",
| "size": 11,
@@ -3797,6 +3807,7 @@ trait EmailSetMethodContract {
| "cid": "def"
| },
| {
+ | "cid": null, "language": null, "location": null, "name": null,
| "partId": "8",
| "blobId": "${messageId}_8",
| "size": 11,
@@ -3807,6 +3818,7 @@ trait EmailSetMethodContract {
| ],
| "htmlBody": [
| {
+ | "cid": null, "disposition": null, "language": null, "location": null, "name": null,
| "partId": "5",
| "blobId": "${messageId}_5",
| "size": 166,
@@ -3814,6 +3826,7 @@ trait EmailSetMethodContract {
| "charset": "UTF-8"
| },
| {
+ | "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "disposition": "inline",
| "size": 11,
@@ -3823,6 +3836,7 @@ trait EmailSetMethodContract {
| "cid": "abc"
| },
| {
+ | "language": null, "location": null, "name": null,
| "charset": "UTF-8",
| "disposition": "inline",
| "size": 11,
@@ -3966,18 +3980,23 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type": "multipart/mixed",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "multipart/related",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "multipart/alternative",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "type": "text/html"
| }
| ]
@@ -3995,6 +4014,7 @@ trait EmailSetMethodContract {
| ]
| },
| {
+ | "cid": null,
| "type": "text/plain",
| "disposition": "attachment"
| }
@@ -4113,20 +4133,25 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type": "multipart/mixed",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type":"multipart/alternative",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type":"text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "type":"text/html"
| }
| ]
| },
| {
+ | "cid": null,
| "type": "text/plain",
| "disposition": "attachment"
| }
@@ -4224,12 +4249,15 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "header:Specific:asText": "MATCHME",
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "header:Specific:asText": "MATCHME",
| "type": "text/html"
| }
@@ -4327,12 +4355,15 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "header:Specific:asText": "MATCHME",
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "header:Specific:asText": "MATCHME",
| "type": "text/html"
| }
@@ -4518,15 +4549,19 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type": "multipart/related",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type":"multipart/alternative",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type":"text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "type":"text/html"
| }
| ]
@@ -4667,12 +4702,15 @@ trait EmailSetMethodContract {
| {
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type":"multipart/alternative",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type":"text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "type":"text/html"
| }
| ]
@@ -4780,14 +4818,17 @@ trait EmailSetMethodContract {
| {
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type": "multipart/alternative",
| "charset": "US-ASCII",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "text/plain",
| "charset": "UTF-8"
| },
| {
+ | "cid": null, "disposition": null,
| "type": "text/html",
| "charset": "UTF-8"
| }
@@ -4937,18 +4978,23 @@ trait EmailSetMethodContract {
s"""{
| "id": "$messageId",
| "bodyStructure": {
+ | "cid": null, "disposition": null,
| "type": "multipart/mixed",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "multipart/related",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "multipart/alternative",
| "subParts": [
| {
+ | "cid": null, "disposition": null,
| "type": "text/plain"
| },
| {
+ | "cid": null, "disposition": null,
| "type": "text/html"
| }
| ]
@@ -4966,6 +5012,7 @@ trait EmailSetMethodContract {
| ]
| },
| {
+ | "cid": null,
| "type": "text/plain",
| "disposition": "attachment"
| }
@@ -5079,6 +5126,7 @@ trait EmailSetMethodContract {
| "attachments": [
| {
| "name": "myAttachment",
+ | "cid": null,
| "partId": "4",
| "blobId": "${messageId}_4",
| "size": 11,
@@ -8773,6 +8821,7 @@ trait EmailSetMethodContract {
| }],
| "id": "$messageId",
| "from": [{
+ | "name": null,
| "email": "${bobUsername.asString}"
| }
| ]}]""".stripMargin)
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentityGetContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentityGetContract.scala
index 17c25b3dba..99a18ca10a 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentityGetContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentityGetContract.scala
@@ -150,6 +150,7 @@ trait IdentityGetContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "bcc": null, "replyTo": null,
| "id": "$defaultIdentityId",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
@@ -257,6 +258,7 @@ trait IdentityGetContract {
| "id": "$defaultIdentityId",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -265,6 +267,7 @@ trait IdentityGetContract {
| "id": "$bobAliasIdentityId",
| "name": "${bobAliasLocalPart}@domain.tld",
| "email": "${bobAliasLocalPart}@domain.tld",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -308,6 +311,7 @@ trait IdentityGetContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "bcc": null, "replyTo": null,
| "id": "$bobAliasIdentityId",
| "name": "${bobAliasLocalPart}@domain.tld",
| "email": "${bobAliasLocalPart}@domain.tld",
@@ -360,6 +364,7 @@ trait IdentityGetContract {
| "id": "$defaultIdentityId",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -368,6 +373,7 @@ trait IdentityGetContract {
| "id": "$bobDomainAliasIdentityId",
| "name": "${bobLocalPart}@$domainAlias",
| "email": "${bobLocalPart}@$domainAlias",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -376,6 +382,7 @@ trait IdentityGetContract {
| "id": "$bobAliasIdentityId",
| "name": "${bobAliasLocalPart}@domain.tld",
| "email": "${bobAliasLocalPart}@domain.tld",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -384,6 +391,7 @@ trait IdentityGetContract {
| "id": "$bobAliasDomainAliasIdentityId",
| "name": "${bobAliasLocalPart}@$domainAlias",
| "email": "${bobAliasLocalPart}@$domainAlias",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":""
@@ -432,6 +440,7 @@ trait IdentityGetContract {
| "id": "$defaultIdentityId",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":"",
@@ -441,6 +450,7 @@ trait IdentityGetContract {
| "id": "$bobDomainAliasIdentityId",
| "name": "${bobLocalPart}@$domainAlias",
| "email": "${bobLocalPart}@$domainAlias",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":"",
@@ -450,6 +460,7 @@ trait IdentityGetContract {
| "id": "$bobAliasIdentityId",
| "name": "${bobAliasLocalPart}@domain.tld",
| "email": "${bobAliasLocalPart}@domain.tld",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":"",
@@ -459,6 +470,7 @@ trait IdentityGetContract {
| "id": "$bobAliasDomainAliasIdentityId",
| "name": "${bobAliasLocalPart}@$domainAlias",
| "email": "${bobAliasLocalPart}@$domainAlias",
+ | "replyTo": null, "bcc": null,
| "mayDelete": false,
| "textSignature":"",
| "htmlSignature":"",
@@ -504,6 +516,7 @@ trait IdentityGetContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "bcc": null, "replyTo": null,
| "id": "$defaultIdentityId",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
index d55ea38c65..8d30f07f8b 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
@@ -179,6 +179,7 @@ trait IdentitySetContract {
| "mayDelete": true
| },
| {
+ | "bcc": null, "replyTo": null,
| "id": "${UUID.nameUUIDFromBytes(bobUsername.asString.getBytes(StandardCharsets.UTF_8))}",
| "name": "${bobUsername.asString}",
| "email": "${bobUsername.asString}",
@@ -1234,6 +1235,7 @@ trait IdentitySetContract {
| "id": "$identityId",
| "bcc": [
| {
+ | "name": null,
| "email": "david2@domain.tld"
| }
| ],
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
index 725e6c13df..5baa40a018 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
@@ -2491,6 +2491,8 @@ trait MailboxChangesMethodContract {
| {
| "id": "$mailboxId1",
| "name": "mailbox1",
+ | "parentId": null,
+ | "role": null,
| "sortOrder": 1000,
| "totalEmails": 1,
| "unreadEmails": 1,
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxGetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxGetMethodContract.scala
index 133603c01d..5af0d3dcbe 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxGetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxGetMethodContract.scala
@@ -196,6 +196,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
@@ -266,6 +267,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
@@ -341,6 +343,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
@@ -417,6 +420,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
@@ -1659,6 +1663,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
@@ -1734,6 +1739,7 @@ trait MailboxGetMethodContract {
| "accountId": "$bobAccountId",
| "list": [
| {
+ | "parentId": null, "role": null,
| "id": "${mailboxId}",
| "name": "custom",
| "sortOrder": 1000,
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
index c2f13885fd..a67b3d3e1d 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
@@ -7737,6 +7737,7 @@ trait MailboxSetMethodContract {
| ["Mailbox/get", {
| "accountId": "$bobAccountId",
| "list": [{
+ | "parentId": null,
| "id": "${mailboxId.serialize}",
| "name": "mailbox"
| }],
@@ -7809,6 +7810,7 @@ trait MailboxSetMethodContract {
| ["Mailbox/get", {
| "accountId": "$bobAccountId",
| "list": [{
+ | "parentId": null,
| "id": "${mailboxId.serialize}",
| "name": "newName"
| }],
@@ -7882,6 +7884,7 @@ trait MailboxSetMethodContract {
| ["Mailbox/get", {
| "accountId": "$bobAccountId",
| "list": [{
+ | "parentId": null,
| "id": "${mailboxId.serialize}",
| "name": "newName"
| }],
@@ -7952,6 +7955,7 @@ trait MailboxSetMethodContract {
| ["Mailbox/get", {
| "accountId": "$bobAccountId",
| "list": [{
+ | "parentId": null,
| "id": "${mailboxId.serialize}",
| "name": "mailbox"
| }],
@@ -8800,6 +8804,7 @@ trait MailboxSetMethodContract {
| "state": "$${json-unit.ignore}",
| "list": [{
| "id": "${parentId.serialize}",
+ | "parentId": null,
| "name": "parent",
| "rights": {
| "${andreUsername.asString()}": ["l"]
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
index 4ffb38dae1..84b8dec88e 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
@@ -768,12 +768,14 @@ trait PushSubscriptionSetMethodContract {
| {
| "list": [
| {
+ | "verificationCode": null,
| "id": "${pushSubscription1.id.serialise}",
| "deviceClientId": "12c6d086",
| "expires": "${UTCDate(pushSubscription1.expires.value).asUTC.format(TIME_FORMATTER)}",
| "types": ["Mailbox"]
| },
| {
+ | "verificationCode": null,
| "id": "${pushSubscription2.id.serialise}",
| "deviceClientId": "12c6d087",
| "expires": "${UTCDate(pushSubscription2.expires.value).asUTC.format(TIME_FORMATTER)}",
@@ -930,12 +932,14 @@ trait PushSubscriptionSetMethodContract {
| {
| "list": [
| {
+ | "verificationCode": null,
| "id": "${pushSubscription1.id.serialise}",
| "deviceClientId": "12c6d086",
| "expires": "${UTCDate(pushSubscription1.expires.value).asUTC.format(TIME_FORMATTER)}",
| "types": ["Mailbox"]
| },
| {
+ | "verificationCode": null,
| "id": "${pushSubscription2.id.serialise}",
| "deviceClientId": "12c6d087",
| "expires": "${UTCDate(pushSubscription2.expires.value).asUTC.format(TIME_FORMATTER)}",
@@ -1048,7 +1052,7 @@ trait PushSubscriptionSetMethodContract {
val request: String =
"""{
| "using": ["urn:ietf:params:jmap:core"],
- | "methodCalls": [ [ "PushSubscription/get", { "properties": ["types"] }, "c1" ] ]
+ | "methodCalls": [ [ "PushSubscription/get", { "properties": ["types", "verificationCode"] }, "c1" ] ]
|}""".stripMargin
val response: String = `given`
@@ -1074,11 +1078,11 @@ trait PushSubscriptionSetMethodContract {
| "list": [
| {
| "id": "${pushSubscription1.id.serialise}",
- | "types": ["Mailbox"]
+ | "verificationCode": null, "types": ["Mailbox"]
| },
| {
| "id": "${pushSubscription2.id.serialise}",
- | "types": ["Email"]
+ | "verificationCode": null, "types": ["Email"]
| }
| ]
| },
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala
index fa592a1f18..947d72410a 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala
@@ -238,6 +238,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100Octets99State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -250,6 +251,7 @@ trait QuotaGetMethodContract {
| "scope": "account"
| },
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobOctetsQuotaName",
| "id": "$bobOctetsQuotaId",
@@ -314,6 +316,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -426,6 +429,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100Octets99State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -438,6 +442,7 @@ trait QuotaGetMethodContract {
| "scope": "account"
| },
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobOctetsQuotaName",
| "id": "$bobOctetsQuotaId",
@@ -552,6 +557,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100Octets900State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -626,6 +632,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100Octets900WithUsageState",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 1,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -638,6 +645,7 @@ trait QuotaGetMethodContract {
| "scope": "account"
| },
| {
+ | "softLimit": null, "description": null,
| "used": 85,
| "name": "$bobOctetsQuotaName",
| "id": "$bobOctetsQuotaId",
@@ -934,7 +942,7 @@ trait QuotaGetMethodContract {
| {
| "accountId": "$bobAccountId",
| "ids": null,
- | "properties": ["name","used","hardLimit"]
+ | "properties": ["name","used","hardLimit","softLimit"]
| },
| "c1"]]
|}""".stripMargin)
@@ -960,7 +968,7 @@ trait QuotaGetMethodContract {
| "id": "$bobCountQuotaId",
| "used": 0,
| "name": "$bobCountQuotaName",
- | "hardLimit": 100
+ | "hardLimit": 100, "softLimit": null
| }
| ],
| "notFound": []
@@ -1120,6 +1128,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100Octets101WithUsageState",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 1,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -1132,6 +1141,7 @@ trait QuotaGetMethodContract {
| "scope": "account"
| },
| {
+ | "softLimit": null, "description": null,
| "used": 85,
| "name": "$bobOctetsQuotaName",
| "id": "$bobOctetsQuotaId",
@@ -1203,6 +1213,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -1275,6 +1286,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100AndreCount88State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -1287,6 +1299,7 @@ trait QuotaGetMethodContract {
| "scope": "account"
| },
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$andreCountQuotaName",
| "warnLimit": 79,
@@ -1357,6 +1370,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
@@ -1429,6 +1443,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100AndreCount88State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$andreCountQuotaName",
| "warnLimit": 79,
@@ -1495,6 +1510,7 @@ trait QuotaGetMethodContract {
| "state": "$bobCount100State",
| "list": [
| {
+ | "softLimit": null, "description": null,
| "used": 0,
| "name": "$bobCountQuotaName",
| "id": "$bobCountQuotaId",
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseGetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseGetMethodContract.scala
index 55df0c1b81..5733f9155b 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseGetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseGetMethodContract.scala
@@ -167,6 +167,7 @@ trait VacationResponseGetMethodContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "fromDate": null, "htmlBody": null, "subject": null, "textBody": null, "toDate": null,
| "id":"singleton",
| "isEnabled": false
| }
@@ -342,6 +343,7 @@ trait VacationResponseGetMethodContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "fromDate": null, "htmlBody": null, "subject": null, "textBody": null, "toDate": null,
| "id":"singleton",
| "isEnabled": false
| }
@@ -429,6 +431,7 @@ trait VacationResponseGetMethodContract {
| "state": "${INSTANCE.value}",
| "list": [
| {
+ | "fromDate": null, "htmlBody": null, "subject": null, "textBody": null, "toDate": null,
| "id":"singleton",
| "isEnabled": false
| }
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailGetSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailGetSerializer.scala
index 001a3874c8..d47c7e2ec8 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailGetSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailGetSerializer.scala
@@ -80,9 +80,9 @@ object EmailGetSerializer {
private implicit val languagesFormat: Format[Languages] = Json.valueFormat[Languages]
private implicit val locationWrites: Writes[Location] = Json.valueWrites[Location]
private implicit val emailerNameWrites: Writes[EmailerName] = Json.valueWrites[EmailerName]
- private implicit val emailAddressWrites: Writes[EmailAddress] = Json.writes[EmailAddress]
+ private implicit val emailAddressWrites: Writes[EmailAddress] = writesNull.writes[EmailAddress]
private implicit val uncheckedEmailWrites: Writes[UncheckedEmail] = Json.valueWrites[UncheckedEmail]
- private implicit val uncheckedEmailAddressWrites: Writes[UncheckedEmailAddress] = Json.writes[UncheckedEmailAddress]
+ private implicit val uncheckedEmailAddressWrites: Writes[UncheckedEmailAddress] = writesNull.writes[UncheckedEmailAddress]
private implicit val headerMessageIdWrites: Writes[HeaderMessageId] = Json.valueWrites[HeaderMessageId]
private implicit val isEncodingProblemWrites: Writes[IsEncodingProblem] = Json.valueWrites[IsEncodingProblem]
private implicit val isTruncatedWrites: Writes[IsTruncated] = Json.valueWrites[IsTruncated]
@@ -142,16 +142,16 @@ object EmailGetSerializer {
private implicit val bodyPartWritesToSerializeWrites: Writes[EmailBodyPartToSerialize] = (
(__ \ "partId").write[PartId] and
- (__ \ "blobId").writeNullable[BlobId] and
+ (__ \ "blobId").write[Option[BlobId]] and
(__ \ "headers").write[List[EmailHeader]] and
(__ \ "size").write[Size] and
- (__ \ "name").writeNullable[Name] and
+ (__ \ "name").write[Option[Name]] and
(__ \ "type").write[Type] and
- (__ \ "charset").writeNullable[Charset] and
- (__ \ "disposition").writeNullable[Disposition] and
- (__ \ "cid").writeNullable[Cid] and
- (__ \ "language").writeNullable[Languages] and
- (__ \ "location").writeNullable[Location] and
+ (__ \ "charset").write[Option[Charset]] and
+ (__ \ "disposition").write[Option[Disposition]] and
+ (__ \ "cid").write[Option[Cid]] and
+ (__ \ "language").write[Option[Languages]] and
+ (__ \ "location").write[Option[Location]] and
(__ \ "subParts").lazyWriteNullable(implicitly[Writes[List[EmailBodyPartToSerialize]]](list => new JsArray(list.map(bodyPartWritesToSerializeWrites.writes).toIndexedSeq) )) and
JsPath.write[Map[String, Option[EmailHeaderValue]]]
)(unlift(EmailBodyPartToSerialize.unapply))
@@ -159,7 +159,7 @@ object EmailGetSerializer {
private implicit val bodyPartWrites: Writes[EmailBodyPart] = part => bodyPartWritesToSerializeWrites.writes(EmailBodyPartToSerialize.from(part))
private implicit val emailMetadataWrites: OWrites[EmailMetadata] = Json.writes[EmailMetadata]
- private implicit val emailHeadersWrites: Writes[EmailHeaders] = Json.writes[EmailHeaders]
+ private implicit val emailHeadersWrites: Writes[EmailHeaders] = writesNull.writes[EmailHeaders]
private implicit val attachmentsMetadataWrites: Writes[AttachmentsMetadata] = Json.writes[AttachmentsMetadata]
private implicit val emailBodyMetadataWrites: Writes[EmailBodyMetadata] = Json.writes[EmailBodyMetadata]
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/IdentitySerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/IdentitySerializer.scala
index 8936606f07..7767a50050 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/IdentitySerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/IdentitySerializer.scala
@@ -47,12 +47,14 @@ object IdentitySerializer {
}
private implicit val identityIdUnparsedFormat: Format[UnparsedIdentityId] = Json.valueFormat[UnparsedIdentityId]
private implicit val identityIdsFormat: Format[IdentityIds] = Json.valueFormat[IdentityIds]
- private implicit val emailAddressReads: Format[EmailAddress] = Json.format[EmailAddress]
+ private implicit val emailAddressReads: Format[EmailAddress] = Format(
+ Json.reads[EmailAddress],
+ writesNull.writes[EmailAddress])
private implicit val nameWrites: Format[IdentityName] = Json.valueFormat[IdentityName]
private implicit val textSignatureWrites: Format[TextSignature] = Json.valueFormat[TextSignature]
private implicit val htmlSignatureWrites: Format[HtmlSignature] = Json.valueFormat[HtmlSignature]
private implicit val mayDeleteWrites: Writes[MayDeleteIdentity] = Json.valueWrites[MayDeleteIdentity]
- private implicit val identityWrites: Writes[Identity] = Json.writes[Identity]
+ private implicit val identityWrites: Writes[Identity] = writesNull.writes[Identity]
private implicit val identityGetRequestReads: Reads[IdentityGetRequest] = Json.reads[IdentityGetRequest]
private implicit val stateWrites: Writes[UuidState] = Json.valueWrites[UuidState]
private implicit val identityGetResponseWrites: OWrites[IdentityGetResponse] = Json.writes[IdentityGetResponse]
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/MailboxSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/MailboxSerializer.scala
index f4c027f675..6a2fdcd3bb 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/MailboxSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/MailboxSerializer.scala
@@ -113,7 +113,7 @@ class MailboxSerializer @Inject()(mailboxIdFactory: MailboxId.Factory) {
mapWrites[QuotaId, Quota](_.getName, quotaWrites)
private implicit val quotasWrites: Writes[Quotas] = Json.valueWrites[Quotas]
- implicit val mailboxWrites: Writes[Mailbox] = Json.writes[Mailbox]
+ implicit val mailboxWrites: Writes[Mailbox] = writesNull.writes[Mailbox]
implicit val mailboxCreationResponseWrites: Writes[MailboxCreationResponse] = Json.writes[MailboxCreationResponse]
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/PushSubscriptionSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/PushSubscriptionSerializer.scala
index 2d65228650..1ad1345b76 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/PushSubscriptionSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/PushSubscriptionSerializer.scala
@@ -80,7 +80,7 @@ class PushSubscriptionSerializer @Inject()(typeStateFactory: TypeStateFactory) {
private implicit val idsFormat: Format[Ids] = Json.valueFormat[Ids]
private implicit val pushSubscriptionSetRequestReads: Reads[PushSubscriptionSetRequest] = Json.reads[PushSubscriptionSetRequest]
private implicit val pushSubscriptionGetRequestReads: Reads[PushSubscriptionGetRequest] = Json.reads[PushSubscriptionGetRequest]
- private implicit val pushSubscriptionWrites: Writes[PushSubscriptionDTO] = Json.writes[PushSubscriptionDTO]
+ private implicit val pushSubscriptionWrites: Writes[PushSubscriptionDTO] = writesNull.writes[PushSubscriptionDTO]
private implicit val pushSubscriptionGetResponseWrites: OWrites[PushSubscriptionGetResponse] = Json.writes[PushSubscriptionGetResponse]
private implicit val pushSubscriptionCreationResponseWrites: Writes[PushSubscriptionCreationResponse] = Json.writes[PushSubscriptionCreationResponse]
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/QuotaSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/QuotaSerializer.scala
index c6fb5f90f5..9b9fdeab64 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/QuotaSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/QuotaSerializer.scala
@@ -68,7 +68,7 @@ object QuotaSerializer {
private implicit val quotaNameWrites: Writes[QuotaName] = Json.valueWrites[QuotaName]
private implicit val quotaDescriptionWrites: Writes[QuotaDescription] = Json.valueWrites[QuotaDescription]
- private implicit val jmapQuotaWrites: Writes[JmapQuota] = Json.writes[JmapQuota]
+ private implicit val jmapQuotaWrites: Writes[JmapQuota] = writesNull.writes[JmapQuota]
private implicit val quotaNotFoundWrites: Writes[QuotaNotFound] =
notFound => JsArray(notFound.value.toList.map(id => JsString(id.id.value)))
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/VacationSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/VacationSerializer.scala
index 5862078152..4c27094f31 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/VacationSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/VacationSerializer.scala
@@ -66,7 +66,7 @@ object VacationSerializer {
private implicit val textBodyWrites: Writes[TextBody] = Json.valueWrites[TextBody]
private implicit val htmlBodyWrites: Writes[HtmlBody] = Json.valueWrites[HtmlBody]
- private implicit val vacationResponseWrites: Writes[VacationResponse] = Json.writes[VacationResponse]
+ private implicit val vacationResponseWrites: Writes[VacationResponse] = writesNull.writes[VacationResponse]
private implicit val vacationResponseIdsReads: Reads[VacationResponseIds] = Json.valueReads[VacationResponseIds]
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala
index 75c0286b95..d509c74700 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala
@@ -34,6 +34,8 @@ import scala.annotation.nowarn
import scala.util.{Failure, Success, Try}
package object json {
+ private[json] val writesNull = Json.configured(JsonConfiguration(optionHandlers = OptionHandlers.WritesNull))
+
implicit val jsObjectReads: Reads[JsObject] = {
case o: JsObject => JsSuccess(o)
case _ => JsError("Expecting a JsObject as a creation entry")
diff --git a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/QuotaSerializerTest.scala b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/QuotaSerializerTest.scala
index 7fa4d6d852..b04cd3b5c2 100644
--- a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/QuotaSerializerTest.scala
+++ b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/QuotaSerializerTest.scala
@@ -141,6 +141,8 @@ class QuotaSerializerTest extends AnyWordSpec with Matchers {
| "state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
| "list": [
| {
+ | "limit": null,
+ | "dataTypes": null,
| "id": "aHR0cHM6Ly93d3cuYmFzZTY0ZW5jb2RlLm9yZy8",
| "resourceType": "count",
| "used": 1,
@@ -240,6 +242,11 @@ class QuotaSerializerTest extends AnyWordSpec with Matchers {
| "state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
| "list": [
| {
+ | "limit": null,
+ | "dataTypes": null,
+ | "warnLimit": null,
+ | "softLimit": null,
+ | "description": null,
| "id": "aHR0cHM6Ly93d3cuYmFzZTY0ZW5jb2RlLm9yZy8",
| "resourceType": "count",
| "used": 1,
@@ -251,6 +258,11 @@ class QuotaSerializerTest extends AnyWordSpec with Matchers {
| ]
| },
| {
+ | "limit": null,
+ | "dataTypes": null,
+ | "warnLimit": null,
+ | "softLimit": null,
+ | "description": null,
| "id": "aHR0cHM6Ly93d3cuYmFzZTY0ZW5jb2RlLm9yZy9",
| "resourceType": "octets",
| "used": 1,
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org