This project contains set of rules allowing to migrate Scala 2 macro-annotation based codecs into Scala 3 built-in derivation.
Main rule, detects usages of macro-annotations or derivation from circe-generic-extras and replaces them with the counterparts defined in circe core Scala 3 library.
Compatible with Circe 0.14.7 or later.
Can be used to migrate usages of both circe-generic-extras and circe-derivation (partially) to Scala 3.
Supported rewrites:
- -
JsonCodecmacro-annotations - replaced withCodecderivation; - -
ConfiguredJsonCodecmacro-annotations - replaced withConfiguredCodecderivation; - -
ConfiguredJsonCodec(encodeOnly = true)/ConfiguredJsonCodec(decodeOnly = true)- rewritten intoConfiguredEncoderorConfiguredDecoderderived instances; - -
@JsonKeyannotations - field names defined in primary constructor or as member fields are transformed into dedicatedConfigurationinstance; - -
generic.extras.semiauto:- -
deriveCodec[T],deriveDecoder[T],deriveEncoder[T], - replaces calls to methods defined inio.circe.generic.extras.semiauto._with their counterpart inio.circe.generic.semiauto._, does not requrie implicitConfiguration. Requiresio.circe::circe-genericdependency - -
deriveConfiguredCodec[T],deriveConfiguredDecoder[T],deriveConfiguredEncoder[T]- rewritten intoCodec.derived/Decoder.derivedConfigured/Encoder.derived - -
deriveUnwrappedCodec[T],deriveUnwrappedDecoder[T],deriveUnwrappedEncoder[T]- rewritten intoCodec/Decoder/Encoderconstructed from value class underlying type andmap/contramapoperations. - -
deriveEnumerationCodec[T],deriveEnumerationDecoder[T],deriveEnumerationEncoder[T]- not yet supported - -
deriveFor- no replacement in Scala 3 - -
deriveExtrasCodec[T],deriveExtrasDecoder[T],deriveExtrasEncoder[T]: no replecement in Scala 3
- -
Simple rule allowing to adopt to json string interpolator changes done in Scala 3. Would rewrite imports io.circe.literal.JsonStringContext into io.circe.literal.json.
For information on how to use this projects refer to Scalafix user guide