This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 6bef18ade4dc8bb48450f102a3cf69d7bb243b16
Author: Benoit Tellier <btell...@linagora.com>
AuthorDate: Mon Aug 17 15:19:18 2020 +0700

    JAMES-3359 MailboxSetError "property" should use valueWrites
---
 .../rfc8621/contract/MailboxSetMethodContract.scala    | 18 +++++++-----------
 .../scala/org/apache/james/jmap/json/Serializer.scala  |  2 +-
 2 files changed, 8 insertions(+), 12 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/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 cebae49..8d682ca 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
@@ -993,7 +993,7 @@ trait MailboxSetMethodContract {
          |        "C42": {
          |          "type": "invalidArguments",
          |          "description": "${mailboxId.serialize()} can not be found",
-         |          "properties":{"value":["parentId"]}
+         |          "properties":["parentId"]
          |        }
          |      }
          |    },
@@ -1050,7 +1050,7 @@ trait MailboxSetMethodContract {
          |        "C42": {
          |          "type": "invalidArguments",
          |          "description": "Mailbox with 
name=#private:b...@domain.tld:mailbox already exists.",
-         |          "properties":{"value":["name"]}
+         |          "properties":["name"]
          |        }
          |      }
          |    },
@@ -1106,7 +1106,7 @@ trait MailboxSetMethodContract {
          |        "C42": {
          |          "type": "invalidArguments",
          |          "description": "Mailbox name exceeds maximum size of 200 
characters",
-         |          "properties":{"value":["name"]}
+         |          "properties":["name"]
          |        }
          |      }
          |    },
@@ -1168,7 +1168,7 @@ trait MailboxSetMethodContract {
          |        "C42": {
          |          "type": "forbidden",
          |          "description": "Insufficient rights",
-         |          "properties":{"value":["parentId"]}
+         |          "properties":["parentId"]
          |        }
          |      }
          |    },
@@ -2253,9 +2253,7 @@ trait MailboxSetMethodContract {
          |                             "${mailboxId1.serialize()}": {
          |                                     "type": "invalidArguments",
          |                                     "description": "Mailbox with 
name=#private:b...@domain.tld:newName already exists.",
-         |                                     "properties": {
-         |                                             "value": ["/name"]
-         |                                     }
+         |                                     "properties": ["/name"]
          |                             }
          |                     }
          |             }, "c1"]
@@ -2308,9 +2306,7 @@ trait MailboxSetMethodContract {
          |                             "${mailboxId1.serialize()}": {
          |                                     "type": "invalidArguments",
          |                                     "description": "Mailbox name 
exceeds maximum size of 200 characters",
-         |                                     "properties": {
-         |                                             "value": ["/name"]
-         |                                     }
+         |                                     "properties": ["/name"]
          |                             }
          |                     }
          |             }, "c1"]
@@ -2471,7 +2467,7 @@ trait MailboxSetMethodContract {
          |                             "${mailboxId.serialize()}": {
          |                                     "type": "invalidArguments",
          |                                     "description": "Invalid change 
to a system mailbox",
-         |          "properties":{"value":["/name"]}
+         |          "properties":["/name"]
          |                             }
          |                     }
          |             }, "c1"]
diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/Serializer.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/Serializer.scala
index a813bf3..eae6a9d 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/Serializer.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/Serializer.scala
@@ -293,7 +293,7 @@ class Serializer @Inject() (mailboxIdFactory: 
MailboxId.Factory) {
 
   private implicit val mailboxSetUpdateResponseWrites: 
Writes[MailboxUpdateResponse] = Json.valueWrites[MailboxUpdateResponse]
 
-  private implicit val propertiesWrites: Writes[Properties] = 
Json.writes[Properties]
+  private implicit val propertiesWrites: Writes[Properties] = 
Json.valueWrites[Properties]
 
   private implicit val setErrorDescriptionWrites: Writes[SetErrorDescription] 
= Json.valueWrites[SetErrorDescription]
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to