aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jakob@driver.xyz>2017-09-06 14:30:16 -0700
committerJakob Odersky <jakob@driver.xyz>2017-09-06 14:30:16 -0700
commitea0884b02daa719a6936abe6b15bc80d9a80a71f (patch)
tree3d575ccc0753f99ca805bfa4f675929fc0967e9e
parentd58b6242a11a0c97c8c9a12e8b19cd3217f18ade (diff)
downloadrest-query-ea0884b02daa719a6936abe6b15bc80d9a80a71f.tar.gz
rest-query-ea0884b02daa719a6936abe6b15bc80d9a80a71f.tar.bz2
rest-query-ea0884b02daa719a6936abe6b15bc80d9a80a71f.zip
Add missing formats
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documentissue.scala13
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/providerttype.scala12
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordissue.scala13
3 files changed, 14 insertions, 24 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documentissue.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documentissue.scala
index 28b2a5e..a658cfa 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documentissue.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documentissue.scala
@@ -61,17 +61,6 @@ object documentissue {
case _ => deserializationError(s"Expected Json Object as DocumentIssue, but got $json")
}
- implicit val documentIssueWriter = new JsonWriter[DocumentIssue] {
- override def write(obj: DocumentIssue) = JsObject(
- "id" -> obj.id.toJson,
- "startPage" -> obj.startPage.toJson,
- "endPage" -> obj.endPage.toJson,
- "text" -> obj.text.toJson,
- "lastUpdate" -> obj.lastUpdate.toJson,
- "userId" -> obj.userId.toJson,
- "isDraft" -> obj.isDraft.toJson,
- "archiveRequired" -> obj.archiveRequired.toJson
- )
- }
+ implicit val documentIssueFormat: RootJsonFormat[DocumentIssue] = jsonFormat9(DocumentIssue.apply)
}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/providerttype.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/providerttype.scala
new file mode 100644
index 0000000..385feb2
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/providerttype.scala
@@ -0,0 +1,12 @@
+package xyz.driver.pdsuidomain.formats.json.sprayformats
+
+import spray.json._
+import xyz.driver.pdsuidomain.entities.ProviderType
+
+object providertype {
+ import DefaultJsonProtocol._
+ import common._
+
+ implicit val providerTypeFormat: RootJsonFormat[ProviderType] = jsonFormat2(ProviderType.apply)
+
+}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordissue.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordissue.scala
index 4ae04d0..4ac5f6d 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordissue.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordissue.scala
@@ -63,17 +63,6 @@ object recordissue {
case _ => deserializationError(s"Expected Json Object as MedicalRecordIssue, but got $json")
}
- implicit val recordIssueWriter = new JsonWriter[MedicalRecordIssue] {
- override def write(obj: MedicalRecordIssue) = JsObject(
- "id" -> obj.id.toJson,
- "startPage" -> obj.startPage.toJson,
- "endPage" -> obj.endPage.toJson,
- "text" -> obj.text.toJson,
- "lastUpdate" -> obj.lastUpdate.toJson,
- "userId" -> obj.userId.toJson,
- "isDraft" -> obj.isDraft.toJson,
- "archiveRequired" -> obj.archiveRequired.toJson
- )
- }
+ implicit val recordIssueFormat = jsonFormat9(MedicalRecordIssue.apply)
}