circe / circe/circe

Automatic derivation of Codec for Scala 3 union types

Open
#2,393 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2.5k
Forks
546
Avg merge
5d 16h
Merged PRs (30d)
1

Description

It would be great if Circe could automatically derive Encoder/Decoder for Scala union types, for example,

given [A: Decoder, B: Decoder]: Decoder[A | B] = 
  Decoder[A] or Decoder[B].widen

given [A: Encoder, B: Encoder]: Encoder[A | B] =
  Encoder.instance:
    case a: A => Encoder[A].apply(a)
    case b: B => Encoder[B].apply(b)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating Circe's Scala 3 derivation entry points and existing Encoder/Decoder derivation, then compare their behavior with the requested union-type examples; done means automatic Encoder and Decoder instances work for Scala 3 union types.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.