-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Library providing JSON parser that warns about unexpected fields in objects.
--   
--   Please see the README on GitHub at
--   https://github.com/commercialhaskell/aeson-warning-parser#readme
@package aeson-warning-parser
@version 0.1.1

module Data.Aeson.WarningParser

-- | A JSON parser that warns about unexpected fields in objects.
type WarningParser a = WriterT WarningParserMonoid Parser a

-- | Warning output from WarningParser.
data JSONWarning
JSONUnrecognizedFields :: String -> [Text] -> JSONWarning
JSONGeneralWarning :: !Text -> JSONWarning
data WithJSONWarnings a
WithJSONWarnings :: a -> [JSONWarning] -> WithJSONWarnings a

-- | WarningParser version of withObject.
withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a)

-- | Handle warnings in a sub-object.
jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a

-- | Handle warnings in a Traversable of sub-objects.
jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a)

-- | Handle warnings in a Maybe Traversable of sub-objects.
jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a))

-- | Log JSON warnings.
logJSONWarnings :: (MonadReader env m, HasLogFunc env, HasCallStack, MonadIO m) => FilePath -> [JSONWarning] -> m ()
noJSONWarnings :: a -> WithJSONWarnings a

-- | Tell the warning parser about an expected field, so it doesn't warn
--   about it.
tellJSONField :: Text -> WarningParser ()

-- | Convert a WarningParser to a Parser.
unWarningParser :: WarningParser a -> Parser a

-- | Extends the .: warning to include the field name that failed
--   to parse.
(.:) :: FromJSON a => Object -> Text -> Parser a

-- | Extends the .:? warning to include the field name that failed
--   to parse.
(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)

-- | WarningParser version of .:.
(..:) :: FromJSON a => Object -> Text -> WarningParser a

-- | Synonym version of ..:.
(...:) :: FromJSON a => Object -> [Text] -> WarningParser a

-- | WarningParser version of .:?.
(..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a)

-- | Synonym version of ..:?.
(...:?) :: FromJSON a => Object -> [Text] -> WarningParser (Maybe a)

-- | WarningParser version of .!=.
(..!=) :: WarningParser (Maybe a) -> a -> WarningParser a
instance RIO.Prelude.Display.Display Data.Aeson.WarningParser.JSONWarning
instance GHC.Classes.Eq Data.Aeson.WarningParser.JSONWarning
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Aeson.WarningParser.WithJSONWarnings a)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings RIO.PrettyPrint.StylesUpdate.StylesUpdate)
instance GHC.Internal.Base.Functor Data.Aeson.WarningParser.WithJSONWarnings
instance GHC.Internal.Generics.Generic Data.Aeson.WarningParser.WarningParserMonoid
instance GHC.Internal.Generics.Generic (Data.Aeson.WarningParser.WithJSONWarnings a)
instance GHC.Internal.Data.String.IsString Data.Aeson.WarningParser.JSONWarning
instance GHC.Internal.Data.String.IsString Data.Aeson.WarningParser.WarningParserMonoid
instance GHC.Internal.Base.Monoid Data.Aeson.WarningParser.WarningParserMonoid
instance GHC.Internal.Base.Monoid a => GHC.Internal.Base.Monoid (Data.Aeson.WarningParser.WithJSONWarnings a)
instance GHC.Internal.Base.Semigroup Data.Aeson.WarningParser.WarningParserMonoid
instance GHC.Internal.Base.Monoid a => GHC.Internal.Base.Semigroup (Data.Aeson.WarningParser.WithJSONWarnings a)
instance GHC.Internal.Show.Show Data.Aeson.WarningParser.JSONWarning
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Data.Aeson.WarningParser.WithJSONWarnings a)
