zio / zio-json

Fast, secure JSON library with tight ZIO integration.
https://zio.dev/zio-json
Apache License 2.0
407 stars 146 forks source link

Add JsonCodec derivation from encoder and decoder #1115

Closed guersam closed 4 months ago

guersam commented 4 months ago

Currently summon[JsonCodec[zio.json.ast.Json]] fails even though there are implicit encoder and decoder.

This PR allows codec derivation for types that already have encoder and decoder, in the same way of the current collection codec derivation.

guersam commented 4 months ago

There's a problem with Scala 2.12 :thinking: Is it acceptable to provide the derivation for 2.13 or above only?

jdegoes commented 4 months ago

@guersam Yes, that's acceptable.