Created
September 13, 2024 13:48
-
-
Save LightSystem/3fe145cd0aa972b404bd6ff9f83dce86 to your computer and use it in GitHub Desktop.
Circe Codec derivation with discriminator
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
import io.circe.Codec | |
import io.circe.derivation.Configuration | |
enum DiscriminatorCodecEnum derives Codec: | |
case A(field: String) | |
case B(field: String) | |
object DiscriminatorCodecEnum: | |
given Configuration = Configuration(discriminator = Some("type")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment