Copyright | (c) 2019-2021 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Module providing support for data (de)serialization, mainly fromto JSON/ and YAML.
Synopsis
- aesonOptions :: Options
- dropFieldPrefix :: String -> String
- symbolCase :: Char -> String -> String
- prettyPrintYAML :: ToJSON a => a -> Text
JSON/YAML Serialization
aesonOptions :: Options Source #
Custom Aeson encoding options used for generic mapping between data
records and JSON or YAML values. Expects the fields in input to be
without the prefix and with words formated in symbol case
(example: record field uUserName
, JSON field user-name
).
dropFieldPrefix :: String -> String Source #
Drops prefix from camel-case text.
>>>
dropFieldPrefix "xxHelloWorld"
"helloWorld"
Transforms camel-case text into text cased with given symbol.
>>>
symbolCase '-' "fooBar"
"foo-bar"
Pretty Printing
Pretty prints given data as YAML.