This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend metadata model for published_by (#193)
* extend metadata model for published_by Signed-off-by: Chanh Nguyen <chanh.nguyen@zalando.fi>
- Loading branch information
1 parent
2eb7e5d
commit f10ca5a
Showing
3 changed files
with
26 additions
and
8 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
13 changes: 13 additions & 0 deletions
13
src/main/scala/org/zalando/kanadi/models/PublishedBy.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,13 @@ | ||
package org.zalando.kanadi.models | ||
|
||
import io.circe.syntax._ | ||
import io.circe.{Decoder, Encoder} | ||
|
||
final case class PublishedBy(name: String) extends AnyVal | ||
|
||
object PublishedBy { | ||
implicit val publishedByEncoder: Encoder[PublishedBy] = | ||
Encoder.instance[PublishedBy](_.name.asJson) | ||
implicit val publishedByDecoder: Decoder[PublishedBy] = | ||
Decoder[String].map(PublishedBy.apply) | ||
} |
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