File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ camelFrom c s = let (p:ps) = split c s
86
86
data Wibble = Wibble {
87
87
wibbleString :: String
88
88
, wibbleInt :: Int
89
- } deriving (Generic , Show )
89
+ } deriving (Generic , Show , Eq )
90
+
91
+ instance FromJSON Wibble
90
92
91
93
instance ToJSON Wibble where
92
94
toJSON = genericToJSON defaultOptions
@@ -263,6 +265,10 @@ jsonPath = [
263
265
, assertEqual " Seq a"
264
266
(Left " Error in $[2]: expected Int, encountered Boolean" )
265
267
(eitherDecode " [0,1,true]" :: Either String (Seq Int ))
268
+ , assertEqual " Wibble"
269
+ (Left " Error in $.wibbleInt: expected Int, encountered Boolean" )
270
+ (eitherDecode " {\" wibbleString\" :\"\" ,\" wibbleInt\" :true}"
271
+ :: Either String Wibble )
266
272
]
267
273
268
274
------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments