This operator is a wrapper over Aeson's .: operator.
Modulewebdriver-0.12.0.1Haskell2010
Test.WebDriver.JSON
A collection of convenience functions for using and parsing JSON values
within WD. All monadic parse errors are converted to asynchronous
BadJSON exceptions.
These functions are used internally to implement webdriver commands, and may be useful for implementing non-standard commands.
- 2 types
- 14 values
- Packagewebdriver-0.12.0.1
- Exports16
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceJSON.hs
Access a JSON object key
2 declarationsDue to a breaking change in the .:? operator of aeson 0.10 (see https://github.com/bos/aeson/issues/287) that was subsequently reverted, this operator was added to provide consistent behavior compatible with all aeson versions. If the field is either missing or Null, this operator should return a Nothing result.
Conversion from JSON within WD
2 declarationsApostrophes are used to disambiguate these functions from their Data.Aeson counterparts.
Parse a lazy ByteString as a top-level JSON Value, then convert it to an instance of FromJSON..
Tuple functions
0 declarationsConvenience functions for working with tuples.
JSON object constructors
Construct a singleton JSON object from a key and value.
Construct a 2-element JSON object from a pair of keys and a pair of values.
Construct a 3-element JSON object from a triple of keys and a triple of values.
Extracting JSON objects into tuples
Parse a JSON Object as a pair. The first two string arguments specify the keys to extract from the object. The third string is the name of the calling function, for better error reporting.
Parse a JSON Object as a triple. The first three string arguments specify the keys to extract from the object. The fourth string is the name of the calling function, for better error reporting.
Conversion from parser results to WD
2 declarationsThese functions are used to implement the other functions in this module, and could be used to implement other JSON convenience functions
Convert an attoparsec parser result to WD.
Convert an Aeson parser result to WD.
Parse exception
1 declarationparsing commands with no return value
4 declarationsA type indicating that we expect no return value from the webdriver request. Its FromJSON instance parses successfully for any values that indicate lack of a return value (a notion that varies from server to server).
Convenience function to handle webdriver commands with no return value.
Convenience function to ignore result of a webdriver command.