Download the PHP package ajayvohra2005/hack-jmespath without Composer
On this page you can find all versions of the php package ajayvohra2005/hack-jmespath. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajayvohra2005/hack-jmespath
More information about ajayvohra2005/hack-jmespath
Files in ajayvohra2005/hack-jmespath
Package hack-jmespath
Short Description JMESPath search in Hacklang
License MIT
Homepage https://github.com/ajayvohra2005/hack-jmespath.git
Informations about the package hack-jmespath
hack-jmespath
Overview
This Hack package allows one to search and extract elements from a JSON document using JMESPath query language.
Requirements
HHVM 4.123 and above.
Installation
- Git clone this repository
- Install composer
-
In the root directory of this repository, run the command
composer install
To use this package,
composer require ajayvohra2005/hack-jmespath
Running Tests
After installation, run the following command in the root directory of this repository:
./vendor/bin/hacktest tests/
Example Code
Below is a an example for searching a json document using a JMESPath query expression:
which produces the following expected output:
More Examples
See for a complete list of test cases, and more examples.
Decoding JSON Data Types
JSON 'object' type must be represented by a Hack dict. The is not supported for a JSON 'object'. This means if you use the Hack built-in function , the second argument in the function call must be so that associative arrays are used.
JMESPath Query Language
Please refer to the in-depth JMESPath Tutorial to learn about JMESPath json query language.
Acknowledgements
The JMESPath package for PHP in-part inspired this code. See individual source files for copyright acknowledgement.