{-# LANGUAGE RecordWildCards #-}
module Data.OpenApi.SchemaOptions where
import qualified Data.Aeson.Types as Aeson
data SchemaOptions = SchemaOptions
{
SchemaOptions -> String -> String
fieldLabelModifier :: String -> String
, SchemaOptions -> String -> String
constructorTagModifier :: String -> String
, SchemaOptions -> String -> String
datatypeNameModifier :: String -> String
, SchemaOptions -> Bool
allNullaryToStringTag :: Bool
, SchemaOptions -> Bool
unwrapUnaryRecords :: Bool
, SchemaOptions -> SumEncoding
sumEncoding :: Aeson.SumEncoding
}
defaultSchemaOptions :: SchemaOptions
defaultSchemaOptions :: SchemaOptions
defaultSchemaOptions = SchemaOptions :: (String -> String)
-> (String -> String)
-> (String -> String)
-> Bool
-> Bool
-> SumEncoding
-> SchemaOptions
SchemaOptions
{ fieldLabelModifier :: String -> String
fieldLabelModifier = String -> String
forall a. a -> a
id
, constructorTagModifier :: String -> String
constructorTagModifier = String -> String
forall a. a -> a
id
, datatypeNameModifier :: String -> String
datatypeNameModifier = String -> String
forall a. a -> a
id
, allNullaryToStringTag :: Bool
allNullaryToStringTag = Bool
True
, unwrapUnaryRecords :: Bool
unwrapUnaryRecords = Bool
False
, sumEncoding :: SumEncoding
sumEncoding = SumEncoding
Aeson.defaultTaggedObject
}
fromAesonOptions :: Aeson.Options -> SchemaOptions
fromAesonOptions :: Options -> SchemaOptions
fromAesonOptions Options
opts = SchemaOptions
defaultSchemaOptions
{ fieldLabelModifier :: String -> String
fieldLabelModifier = Options -> String -> String
Aeson.fieldLabelModifier Options
opts
, constructorTagModifier :: String -> String
constructorTagModifier = Options -> String -> String
Aeson.constructorTagModifier Options
opts
, allNullaryToStringTag :: Bool
allNullaryToStringTag = Options -> Bool
Aeson.allNullaryToStringTag Options
opts
, unwrapUnaryRecords :: Bool
unwrapUnaryRecords = Options -> Bool
Aeson.unwrapUnaryRecords Options
opts
, sumEncoding :: SumEncoding
sumEncoding = Options -> SumEncoding
Aeson.sumEncoding Options
opts
}