hjsonpointer-1.0.0.1: JSON Pointer library

Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Pointer

Contents

Synopsis

Documentation

newtype Token Source #

We don't try to distinguish between integer tokens and string tokens since all tokens start as strings, and all tokens can be used to resolve JSON objects.

Constructors

Token 

Fields

Instances

Unescaping

data FormatError Source #

Constructors

InvalidFirstChar

JSON Pointers must either be empty or start with a /.

UnescapedTilde 

unescape :: Text -> Either FormatError Pointer Source #

JSON Pointers must either be empty or start with a /. This means that if you're turning a URI Fragment into a JSON Pointer you must drop the initial #.

Note that the unescaping happening here is not the same as URI decoding. If you are turning a URI fragment into a JSON Pointer you must URI decode the Text before using it as an argument to this function. There's an example of how to do this in the tests using "Network.HTTP.Types.URI.urlDecode" from http-types.

unescapeToken :: Text -> Maybe Token Source #

For internal use by unescape.

Resolution

resolveToken :: Token -> Value -> Either ResolutionError Value Source #

For internal use (or specialized applications that don't want to resolve an entire pointer at once).