JSON Encoding and Decoding Functions #22
Unanswered
springcomp
asked this question in
JEP
Replies: 1 comment 3 replies
-
@chris-armstrong I took the liberty to include your proposal here for the next version of JMESPath. Would you be so kind to elaborate one or two use cases that lead you to create those functions and that you could not do using JMESPath as currently specified ? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
JSON Functions (GorillaStack)
Abstract
This document proposes adding functions for manipulating JSON data, including
a
parse_json
andto_json
function.Motivation
There is separate requirements to both parse JSON strings and to serialise
full or partial object structures to JSON.
Specification
The following functions will be added to the specification:
parse_json
Parse string
$json_data
containing JSON data and produce an object structure that can befurther manipulated by JMESPath.
If the string contains invalid JSON, an error should be generated.
to_json
Serialise
$value
to a JSON string. No guarantees are made about formatting - this isimplementation dependent.
Impact
Although this introduces no changes to existing syntax or functions, it may be challenging
to support correctly in implementations other than JavaScript if the underlying language
does not contain a spec-compliant JSON parser or producing arbitrary object structures for
use with JMESPath is difficult.
Beta Was this translation helpful? Give feedback.
All reactions