From 212c10e20a6737873666e48e00d702d8428dd880 Mon Sep 17 00:00:00 2001 From: eikek Date: Sun, 12 Nov 2023 18:48:43 +0100 Subject: [PATCH] Allow custom json Refs: #2334 --- modules/restapi/src/main/resources/docspell-openapi.yml | 3 +-- .../src/main/scala/docspell/restserver/conv/Conversions.scala | 3 +-- project/plugins.sbt | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/restapi/src/main/resources/docspell-openapi.yml b/modules/restapi/src/main/resources/docspell-openapi.yml index 41f9be90..d506c723 100644 --- a/modules/restapi/src/main/resources/docspell-openapi.yml +++ b/modules/restapi/src/main/resources/docspell-openapi.yml @@ -8251,9 +8251,8 @@ components: is discarded. E-mails that don't have any attachments are skipped. customData: - type: string + type: object format: json - default: null description: | Custom user data that gets threaded through the processing. Docspell ignores it completely, but will pass it to the outcome of processing diff --git a/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala b/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala index 2c209f25..cc745186 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala @@ -32,7 +32,6 @@ import docspell.store.queries.{ import docspell.store.records._ import docspell.store.{AddResult, UpdateResult} -import io.circe.Json import org.http4s.headers.`Content-Type` import org.http4s.multipart.Multipart import org.log4s.Logger @@ -317,7 +316,7 @@ trait Conversions { m.language, m.attachmentsOnly, m.flattenArchives, - m.customData.map(Json.fromString) // TODO fix openapi spec + m.customData ) ) ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 923b44bf..beed6745 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") -addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.10.0") +addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.11.0") addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")