-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into TDRSP-15-initiate-met…
…adata-config
- Loading branch information
Showing
5 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/scala/uk/gov/nationalarchives/tdr/transfer/service/api/model/Serializers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
package uk.gov.nationalarchives.tdr.transfer.service.api.model | ||
|
||
import io.circe.{Decoder, Encoder} | ||
import io.circe.generic.AutoDerivation | ||
import sttp.tapir.Schema | ||
import sttp.tapir.generic.auto.SchemaDerivation | ||
import sttp.tapir.generic.{Configuration => TapirConfiguration} | ||
import uk.gov.nationalarchives.tdr.transfer.service.api.model.SourceSystem.SourceSystemEnum | ||
import uk.gov.nationalarchives.tdr.transfer.service.api.model.SourceSystem.SourceSystemEnum.SourceSystem | ||
|
||
object Serializers extends AutoDerivation with SchemaDerivation { | ||
implicit val schemaConfiguration: TapirConfiguration = TapirConfiguration.default.withDiscriminator("type") | ||
|
||
implicit val sourceSystemEnc: Encoder[SourceSystem] = Encoder.encodeEnumeration(SourceSystemEnum) | ||
implicit val genderDec: Decoder[SourceSystem] = Decoder.decodeEnumeration(SourceSystemEnum) | ||
implicit val genderSch: Schema[SourceSystem] = Schema.derivedEnumerationValue[SourceSystem] | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/scala/uk/gov/nationalarchives/tdr/transfer/service/api/model/SourceSystem.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package uk.gov.nationalarchives.tdr.transfer.service.api.model | ||
|
||
object SourceSystem { | ||
object SourceSystemEnum extends Enumeration { | ||
type SourceSystem = Value | ||
val SharePoint: Value = Value("sharepoint") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters