@@ -29,7 +29,7 @@ import Servant.API
2929-- customize the output
3030data CommonGeneratorOptions = CommonGeneratorOptions
3131 {
32− functionRenamer :: FunctionName -> String -- ^ function transforming function names
32+ functionNameBuilder :: FunctionName -> String -- ^ function generating function names
3333 , requestBody :: String -- ^ name used when a user want to send the request body (to let you redefine it)
3434 , successCallback :: String -- ^ name of the callback parameter when the request was successful
3535 , errorCallback :: String -- ^ name of the callback parameter when the request reported an error
@@ -40,7 +40,7 @@ data CommonGeneratorOptions = CommonGeneratorOptions
4040--
4141-- @
4242-- > defCommonGeneratorOptions = CommonGeneratorOptions
43−-- > { functionRenamer = concatRenamer
43+-- > { functionNameBuilder = camelCase
4444-- > , requestBody = "body"
4545-- > , successCallback = "onSuccess"
4646-- > , errorCallback = "onError"
@@ -50,29 +50,29 @@ data CommonGeneratorOptions = CommonGeneratorOptions
5050defCommonGeneratorOptions :: CommonGeneratorOptions
5151defCommonGeneratorOptions = CommonGeneratorOptions
5252 {
53− functionRenamer = concatRenamer
53+ functionNameBuilder = camelCase
5454 , requestBody = "body"
5555 , successCallback = "onSuccess"
5656 , errorCallback = "onError"
5757 , moduleName = ""
5858 }
5959
60−-- | Function renamer that simply concat each part together
61−concatRenamer :: FunctionName -> String
62−concatRenamer = concat
60+-- | Function name builder that simply concat each part together
61+concatCase :: FunctionName -> String
62+concatCase = concat
6363
64−-- | Function renamer using the snake_case convention.
64+-- | Function name builder using the snake_case convention.
6565-- each part is separated by a single underscore character.
66−snakeCaseRenamer :: FunctionName -> String
67−snakeCaseRenamer = intercalate "_"
66+snakeCase :: FunctionName -> String
67+snakeCase = intercalate "_"
6868
69−-- | Function renamer using the CamelCase convention.
69+-- | Function name builder using the CamelCase convention.
7070-- each part begins with an upper case character.
71−camelCaseRenamer :: FunctionName -> String
72−camelCaseRenamer [] = ""
73−camelCaseRenamer (p:ps) = concat $ p : camelCaseRenamer' ps
74− where camelCaseRenamer' [] = []
75− camelCaseRenamer' (r:rs) = capitalize r : camelCaseRenamer' rs
71+camelCase :: FunctionName -> String
72+camelCase [] = ""
73+camelCase (p:ps) = concat $ p : camelCase' ps
74+ where camelCase' [] = []
75+ camelCase' (r:rs) = capitalize r : camelCase' rs
7676 capitalize [] = []
7777 capitalize (x:xs) = toUpper x : xs
7878