Skip to content

FunFunFine/evo-derivation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Derivation

License: MIT Maven Central Build

A derivation library for scala 3 with annotation based configuration.

Usage

add library to your project as

libraryDependencies += "com.evolution" %% "evo-derivation-circe" % "{version}"

Then define your own type, deriving circe instances

import evo.derivation.*
import evo.derivation.circe.*


@SnakeCase
@Discriminator("type")
enum User derives Config, EvoCodec:
    case AuthorizedClient(@Rename("client_id") id: UUID, name: String)
    case Anonymous

Annotation reference

@SnakeCase

Transforms all the constructor and\or field names to the snake case

@Discriminator(name: String)

Defines discriminator field for serialization of sealed trait or enum

@Rename(name: String)

Renames single case class field or enum constructor

@Embed

Write\Reads all inner fields of some field on the upper level during serialization

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%