aeson-warning-parser-0.1.1: Library providing JSON parser that warns about unexpected fields in objects.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aeson.WarningParser

Synopsis

Documentation

type WarningParser a = WriterT WarningParserMonoid Parser a Source #

A JSON parser that warns about unexpected fields in objects.

data WithJSONWarnings a Source #

Constructors

WithJSONWarnings a [JSONWarning] 

Instances

Instances details
Functor WithJSONWarnings Source # 
Instance details

Defined in Data.Aeson.WarningParser

Methods

fmap :: (a -> b) -> WithJSONWarnings a -> WithJSONWarnings b #

(<$) :: a -> WithJSONWarnings b -> WithJSONWarnings a #

FromJSON (WithJSONWarnings StylesUpdate) Source # 
Instance details

Defined in Data.Aeson.WarningParser

Monoid a => Monoid (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

Monoid a => Semigroup (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

Generic (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

Associated Types

type Rep (WithJSONWarnings a) :: Type -> Type #

Show a => Show (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

Eq a => Eq (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

type Rep (WithJSONWarnings a) Source # 
Instance details

Defined in Data.Aeson.WarningParser

type Rep (WithJSONWarnings a) = D1 ('MetaData "WithJSONWarnings" "Data.Aeson.WarningParser" "aeson-warning-parser-0.1.1-7uyxtcAevnvERssje2PtIb" 'False) (C1 ('MetaCons "WithJSONWarnings" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSONWarning])))

jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a Source #

Handle warnings in a sub-object.

jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a) Source #

Handle warnings in a Traversable of sub-objects.

jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a)) Source #

Handle warnings in a Maybe Traversable of sub-objects.

logJSONWarnings :: (MonadReader env m, HasLogFunc env, HasCallStack, MonadIO m) => FilePath -> [JSONWarning] -> m () Source #

Log JSON warnings.

tellJSONField :: Text -> WarningParser () Source #

Tell the warning parser about an expected field, so it doesn't warn about it.

(.:) :: FromJSON a => Object -> Text -> Parser a Source #

Extends the .: warning to include the field name that failed to parse.

(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a) Source #

Extends the .:? warning to include the field name that failed to parse.

(...:) :: FromJSON a => Object -> [Text] -> WarningParser a Source #

Synonym version of ..:.

(...:?) :: FromJSON a => Object -> [Text] -> WarningParser (Maybe a) Source #

Synonym version of ..:?.

(..!=) :: WarningParser (Maybe a) -> a -> WarningParser a Source #

WarningParser version of .!=.