JMESPath Extensions

Our implementation of JMESPath supports the grammar of the official specification, but has been extended with the following concepts:

$ operator

It is possible to reference a previously defined variable in the current scope through the usage of the $ operator.

{
   a: 'test',
   b: $.a
}

results in:

{ "a":"test", "b":"test" }

@@ operator

It is possible to reference the root of input data using the pound sign. It can be both used in a data transformation as well as in underlying user functions.

Example of sample data:

{
	"DocumentOptions": {
		"Language": "en-GB",
		"PaperSize": "A4"
	},
	"People": [
		{
			"StructuredXMLResume": {
				"ContactInfo": {
					"PersonName": {
						"FormattedName": "Ark Mariush"
					}
				}
			}
		},
		{
			"StructuredXMLResume": {
				"ContactInfo": {
					"PersonName": {
						"FormattedName": "Seb Mariusha"
					}
				}
			}
		},
		{
			"StructuredXMLResume": {
				"ContactInfo": {
					"PersonName": {
						"FormattedName": "Bgk Mariushe"
					}
				}
			}
		}
	]
}

Example of @@ usage inside a data transformation:

{
    Data: {
       PeopleTransformed : People[0:3].{
           FormattedName : if (@@.DocumentOptions.Language == 'en-GB', StructuredXMLResume.ContactInfo.PersonName.FormattedName, `null`) 
       }
    }
}