@@ -110,7 +110,7 @@ nonAllNullarySumToJSON :: ( TwoElemArray f
110110nonAllNullarySumToJSON opts =
111111 case sumEncoding opts of
112112 ObjectWithType{..} -> object . objectWithType opts typeFieldName
113− valueFieldName
113+ contentsFieldName
114114 ObjectWithSingleField -> Object . objectWithSingleField opts
115115 TwoElemArray -> Array . twoElemArray opts
116116{-# INLINE nonAllNullarySumToJSON #-}
@@ -122,20 +122,20 @@ class ObjectWithType f where
122122
123123instance ( ObjectWithType a
124124 , ObjectWithType b ) => ObjectWithType (a :+: b) where
125− objectWithType opts typeFieldName valueFieldName (L1 x) =
126− objectWithType opts typeFieldName valueFieldName x
127− objectWithType opts typeFieldName valueFieldName (R1 x) =
128− objectWithType opts typeFieldName valueFieldName x
125+ objectWithType opts typeFieldName contentsFieldName (L1 x) =
126+ objectWithType opts typeFieldName contentsFieldName x
127+ objectWithType opts typeFieldName contentsFieldName (R1 x) =
128+ objectWithType opts typeFieldName contentsFieldName x
129129 {-# INLINE objectWithType #-}
130130
131131instance ( IsRecord a isRecord
132132 , ObjectWithType' a isRecord
133133 , Constructor c ) => ObjectWithType (C1 c a) where
134− objectWithType opts typeFieldName valueFieldName =
134+ objectWithType opts typeFieldName contentsFieldName =
135135 (pack typeFieldName .= constructorNameModifier opts
136136 (conName (undefined :: t c a p)) :) .
137137 (unTagged :: Tagged isRecord [Pair] -> [Pair]) .
138− objectWithType' opts valueFieldName . unM1
138+ objectWithType' opts contentsFieldName . unM1
139139 {-# INLINE objectWithType #-}
140140
141141class ObjectWithType' f isRecord where
@@ -146,8 +146,8 @@ instance (RecordToPairs f) => ObjectWithType' f True where
146146 {-# INLINE objectWithType' #-}
147147
148148instance (GToJSON f) => ObjectWithType' f False where
149− objectWithType' opts valueFieldName =
150− Tagged . (:[]) . (pack valueFieldName .=) . gToJSON opts
149+ objectWithType' opts contentsFieldName =
150+ Tagged . (:[]) . (pack contentsFieldName .=) . gToJSON opts
151151 {-# INLINE objectWithType' #-}
152152
153153--------------------------------------------------------------------------------
@@ -387,7 +387,7 @@ parseNonAllNullarySum opts =
387387 withObject "Object" $ \obj -> do
388388 key <- obj .: pack typeFieldName
389389 fromMaybe (notFound $ unpack key) $
390− parseFromObjectWithType opts valueFieldName obj key
390+ parseFromObjectWithType opts contentsFieldName obj key
391391
392392 ObjectWithSingleField ->
393393 withObject "Object" $ \obj ->
@@ -414,16 +414,16 @@ class FromObjectWithType f where
414414
415415instance (FromObjectWithType a, FromObjectWithType b) =>
416416 FromObjectWithType (a :+: b) where
417− parseFromObjectWithType opts valueFieldName obj key =
418− (fmap L1 <$> parseFromObjectWithType opts valueFieldName obj key) <|>
419− (fmap R1 <$> parseFromObjectWithType opts valueFieldName obj key)
417+ parseFromObjectWithType opts contentsFieldName obj key =
418+ (fmap L1 <$> parseFromObjectWithType opts contentsFieldName obj key) <|>
419+ (fmap R1 <$> parseFromObjectWithType opts contentsFieldName obj key)
420420 {-# INLINE parseFromObjectWithType #-}
421421
422422instance ( FromObjectWithType' f
423423 , Constructor c ) => FromObjectWithType (C1 c f) where
424− parseFromObjectWithType opts valueFieldName obj key
424+ parseFromObjectWithType opts contentsFieldName obj key
425425 | key == name = Just $ M1 <$> parseFromObjectWithType'
426− opts valueFieldName obj
426+ opts contentsFieldName obj
427427 | otherwise = Nothing
428428 where
429429 name = pack $ constructorNameModifier opts $
@@ -442,9 +442,9 @@ class FromObjectWithType'' f isRecord where
442442instance ( IsRecord f isRecord
443443 , FromObjectWithType'' f isRecord
444444 ) => FromObjectWithType' f where
445− parseFromObjectWithType' opts valueFieldName =
445+ parseFromObjectWithType' opts contentsFieldName =
446446 (unTagged :: Tagged isRecord (Parser (f a)) -> Parser (f a)) .
447− parseFromObjectWithType'' opts valueFieldName
447+ parseFromObjectWithType'' opts contentsFieldName
448448 {-# INLINE parseFromObjectWithType' #-}
449449
450450instance (FromRecord f) => FromObjectWithType'' f True where
@@ -452,8 +452,8 @@ instance (FromRecord f) => FromObjectWithType'' f True where
452452 {-# INLINE parseFromObjectWithType'' #-}
453453
454454instance (GFromJSON f) => FromObjectWithType'' f False where
455− parseFromObjectWithType'' opts valueFieldName = Tagged .
456− (gParseJSON opts <=< (.: pack valueFieldName))
455+ parseFromObjectWithType'' opts contentsFieldName = Tagged .
456+ (gParseJSON opts <=< (.: pack contentsFieldName))
457457 {-# INLINE parseFromObjectWithType'' #-}
458458
459459--------------------------------------------------------------------------------