{-|
Module      : Gargantext.Core.Utils.Aeson
Description : 
Copyright   : (c) CNRS, 2017-Present
License     : AGPL + CECILL v3
Maintainer  : team@gargantext.org
Stability   : experimental
Portability : POSIX

-}

module Gargantext.Core.Utils.Aeson where

import Data.Aeson.Types
import Gargantext.Core.Utils.Swagger (modifier)
import Gargantext.Prelude

jsonOptions :: Text -> Options
jsonOptions pref = defaultOptions
  { fieldLabelModifier = modifier pref
  , unwrapUnaryRecords = False
  , omitNothingFields = True
  }
