Skip to content

Add JMESPath expression #4196

@TomasEng

Description

@TomasEng

Our expression language needs a way to perform mapping and filtering on lists of objects. We have decided to add support for the JMESPath standard in the expression language in order to make that possible.

We need to add a function that accepts two arguments:

  • A value of any type to perform the query on
  • The JMESPath query

This function should return whatever the query evaluates to.

Example:

[
  "jmespath",
  [
    "list",
    [ "object", "name", "Ola", "city", "Oslo" ],
    [ "object", "name", "Kari", "city", "Oslo" ],
    [ "object", "name", "Knut", "city", "Brønnøysund" ]
  ],
  "[?city=='Oslo'].name"
]

returns ["Ola", "Kari"].

Relevant links

Acceptance criteria

  • A jmespath function exists in our expression language
  • The function accepts any value as its first argument and a sring as its second argument
  • The function returns the result of the JMESPath query provided in the second arguments evaluated on the value provided in the first argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/logicrelated to logic/dynamics/expressionssquad/dataIssues that belongs to the named squad.
    No fields configured for Feature.

    Projects

    Status

    ⚠️ Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions