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
newtype UserId = ...
instance FromHttpApiData UserId
instance ToJSON UserId
data User = ...
instance ToJSON User
data NewUser = ...
instance FromJSON NewUser
It is not possible to use validateEveryToJSON because it expects instance ToJSON NewUser even though the UserAPI is perfectly usable as NewUser is only used in ReqBody and thus only requires a FromJSON instance.
Of course an easy fix is to just add a ToJSON instance, which is low risk compared to adding FromJSON instances for things you only want to send out.
The text was updated successfully, but these errors were encountered:
With the following API
and only the following instances
It is not possible to use
validateEveryToJSON
because it expectsinstance ToJSON NewUser
even though theUserAPI
is perfectly usable asNewUser
is only used inReqBody
and thus only requires aFromJSON
instance.Of course an easy fix is to just add a
ToJSON
instance, which is low risk compared to addingFromJSON
instances for things you only want to send out.The text was updated successfully, but these errors were encountered: