-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align series/2.x branch codec generation annotations with zio-schema (#…
…155)
- Loading branch information
Showing
10 changed files
with
188 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
package zio.dynamodb | ||
|
||
import zio.Chunk | ||
import zio.schema.annotation.{ caseName, discriminatorName } | ||
|
||
object Annotations { | ||
final case class discriminator(name: String) extends scala.annotation.Annotation | ||
final case class enumOfCaseObjects() extends scala.annotation.Annotation | ||
final case class id(value: String) extends scala.annotation.Annotation | ||
final case class enumOfCaseObjects() extends scala.annotation.Annotation | ||
|
||
def maybeId(annotations: Chunk[Any]): Option[String] = | ||
annotations.collect { case id(name) => name }.headOption | ||
def maybeCaseName(annotations: Chunk[Any]): Option[String] = | ||
annotations.collect { case caseName(name) => name }.headOption | ||
|
||
def maybeDiscriminator(annotations: Chunk[Any]): Option[String] = | ||
annotations.collect { case discriminator(name) => name }.headOption | ||
annotations.collect { case discriminatorName(name) => name }.headOption | ||
} |
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
Oops, something went wrong.