Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions after 1.4.1 seem to have broken reading/writing ADTs using @discriminatorName #803

Open
countfloyd opened this issue Feb 4, 2025 · 0 comments

Comments

@countfloyd
Copy link

A structure like:

@discriminatorName("type")
sealed trait Base:
  def a: String

object Base:
  given Schema[Base] = DeriveSchema.gen

case class BaseA(a: String) extends Base derives Schema
case class BaseB(a: String) extends Base derives Schema

Writing out an object of type BaseA includes the "type" field in 1.4.1 but not 1.6.1.

Also, reading in json with the "type" field works in 1.4.1 but in 1.6.1, I get the error:

Left(.type.BaseA(expected '"' got '{'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant