Commits

basvandijk  committed fcf4ead

Changed default encoding of sum datatypes to ObjectWithType

  • Participants
  • Parent commits 007f5db

Comments (0)

Files changed (2)

File Data/Aeson/Types/Internal.hs

 -- , 'constructorNameModifier' = id
 -- , 'nullaryToString'         = True
 -- , 'omitNothingFields'       = True
--- , 'sumEncoding'             = 'TwoElemArray'
+-- , 'sumEncoding'             = 'defaultObjectWithType'
 -- }
 -- @
 defaultOptions :: Options
                  , constructorNameModifier = id
                  , nullaryToString         = True
                  , omitNothingFields       = True
-                 , sumEncoding             = TwoElemArray
+                 , sumEncoding             = defaultObjectWithType
                  }
 
 -- | Default 'ObjectWithType' 'SumEncoding' options:

File tests/Options.hs

 
 optsDefault :: Options
 optsDefault = defaultOptions{ fieldNameModifier       = map toLower
-                             , constructorNameModifier = map toLower
-                             }
+                            , constructorNameModifier = map toLower
+                            , sumEncoding             = TwoElemArray
+                            }
 
 opts2ElemArray :: Options
 opts2ElemArray = optsDefault{ nullaryToString = False }