-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
With the following API
type UserAPI
= (Capture "user_id" UserId :> Get '[JSON] User)
:<|> (Capture "new" :> ReqBody '[JSON] NewUser :> Post '[JSON] UserId)and only the following instances
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels