-
Notifications
You must be signed in to change notification settings - Fork 7
Change the API to be compatible with the upcoming Scala-3 v… #665
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
base: main
Are you sure you want to change the base?
Conversation
…ersion (details in SCALA-3-MIGRATION-GUIDE.md)
json/json-derivation/src/main/scala/io/sphere/json/generic/JSONMacros.scala
Show resolved
Hide resolved
json/json-derivation/src/test/scala/io/sphere/json/generic/SubTypeNameSpec.scala
Outdated
Show resolved
Hide resolved
List(SingletonMixed, RecordMixed(1)).foreach { m: Mixed => | ||
fromJSON[Mixed](toJSON(m)) must equal(Valid(m)) | ||
} | ||
} | ||
|
||
it("must provide derived instances for scala.Enumeration") { | ||
implicit val scalaEnumJSON = deriveJSON[ScalaEnum.Value] | ||
implicit val scalaEnumJSON: JSON[JSONSpec.ScalaEnum.Value] = jsonEnum(ScalaEnum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use deriveJSON
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enumerations have a fixed implementation, we don't need to "derive" anything, so I didn't add them to the scala-3 deriveJSON. The code is simpler this way.
If you think it's better to have everything under deriveJSON, I can add it to the scala-3 implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we have deriveJSON
for enums in scala 2, it would be nice to have the same in scala 3, unless this is too much work. I let you judge here.
…ersion (details in SCALA-3-MIGRATION-GUIDE.md)