ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Json.Lenient

Description

Optional advisory fields share lenient Aeson decoding across ecosystems.

Synopsis

Documentation

lenientOptional :: (FromJSON a, NFData a) => Object -> Key -> Parser (Maybe a) Source #

Decode an optional field leniently: absent, null, and undecodable yield Nothing, so one poisoned value cannot deny the document. For advisory fields only, never a load-bearing one.

typeMismatchOneOf :: String -> Value -> Parser a Source #

Fail a lenient decoder with a message that names the accepted shapes and the JSON kind it found.

valueKind :: Value -> String Source #

A short description of a JSON value's kind, for parse-error messages.