JMESPath Community Features 1.1 Brainstorming #38
Replies: 2 comments 6 replies
-
I think we should divide the currently proposed changes into backwards compatible and backwards incompatible. For example, Array wildcard expressions ( We could also drop literals,
I think some function operators should be reordered to be consistent. For example, |
Beta Was this translation helpful? Give feedback.
-
LiteralsI think dropping literals completely would be detrimental to expression some expressions with static JSON content. min_by and max_byI think we touch on an issue around ease of use and readibility. If we go back to replacing The only compelling example that I see is the Argument orderingI have listed the signatures for all functions with more than one argument:
Apart from functions with a variadic number of arguments, only two functions indeed stand out
That would however be a breaking change but I think you already alluded to that. Projections and null valuesI’m torn with changing the behaviour of projections that drop Thus, even though Considering the following input object
We would have:
|
Beta Was this translation helpful? Give feedback.
-
This discussion started to list topics that could be included in a next version of JMESPath but still feels a bit abstract or not sufficiently scoped.
A new discussion has been started to define the very next short term milestone.
Here are the topics we currently have:
JEP-11 Lexical ScopingJEP-17 Root Reference. Overloading the$
operator?group_by() function.Simple numeric operations.slice() function acceptingstring
arguments.split() function (does this conflict withslice()
acceptingstring
arguments?trim_left()
andtrim_right()
functions. Variations could be namedtrim_start()
ortrim_end()
. Do we need a standalonetrim()
function?pad_left()
andpad_right()
functions.upper()
andlower()
functions. How to handle Unicode characters, for instance, Turkishı
->I
, vsi
->İ
?title()
function to change case. Could be expanded withcamel()
,snake()
, etc. May seem a bit specific.parse_json()
andto_json()
functions.items(),from_items()
andzip()
functions. In particular,from_items()
would be the favored name for the knownto_object()
function.Those topics lead to discussions that reveal issues around structural behaviour of JMESPath. Those could lead to breaking changes.
null
values after all? Or produce error values ?true
,false
andnull
keywords that have the same meaning as their JSON counterparts? This impacts regular identifiers.*
vs[*]
which are identical apart from the type of the object to which they apply? Should we remove one of the two constructs altogether ?map($expr, $array)
is equivalent to$array[*].$expr
)? Or just deprecate those functions?map()
andjoin()
) for consistency?Please, note that JEP numbers used here are subject to change. The anticipated workflow is to start a discussion on a topic, then proceed to assign a JEP number when this is sufficiently fleshed out.
Beta Was this translation helpful? Give feedback.
All reactions