You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When encoding the Response, it generates JSON like
{
"created": "2023-12-23T12:07:03Z"
}
but the expected one should be
{
"created": 1703333223
}
How to Reproduce
Check out the description
Possible Cause
It looks like the Encoder and Decoder from import refined4s.modules.circe.derivation.instances.given have higher precedence than the ones defined in the companion object.
Possible Solution
Since the following import is required for the pre-defined types (e.g. NonEmptyString, refined numeric, network types, etc.), this is a very common issue.
So, a possible solution might be to provide explicit type-class instances for the pre-defined types and separate them from the generic one (refined4s.modules.circe.derivation.instances).
Summary
All modules: importing
derivation.instances.given
can cause an issue as it overrides all type-classes defined in the companion objectsVersion
0.5.0
but all other versions with modules containgderivation.instances
Scala Version
3
Java Version
n/a
Description
Given
When encoding the
Response
, it generates JSON likebut the expected one should be
How to Reproduce
Check out the description
Possible Cause
It looks like the
Encoder
andDecoder
fromimport refined4s.modules.circe.derivation.instances.given
have higher precedence than the ones defined in the companion object.Possible Solution
Since the following import is required for the pre-defined types (e.g.
NonEmptyString
, refined numeric, network types, etc.), this is a very common issue.So, a possible solution might be to provide explicit type-class instances for the pre-defined types and separate them from the generic one (
refined4s.modules.circe.derivation.instances
).refined4s-circe
] Add explicitEncoder
andDecoder
for pre-defined types #166refined4s-cats
] Add explicitEq
andShow
for pre-defined types #171refined4s-pureconfig
] Add explicitConfigReader
andConfigWriter
for pre-defined types #172refined4s-doobie
] Add explicitGet
andPut
for pre-defined types #173The text was updated successfully, but these errors were encountered: