Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Command add - Support for JSON object with dynamic values #56

Open
ifranlaloe opened this issue Feb 17, 2023 · 1 comment

Comments

@ifranlaloe
Copy link

The command add does not support adding a JSON object with Dynamic values. I think that this could improve the readability, complexity and number of lines of a JLIO script by being able to combine multiple add commands.

[
  {
    "path": "$.TransfResult",
    "description": "Values",
    "value": {
      "orderId": "Static String",
      "orderDetails": "${$.request.orders[*].items[*].descriptions[*].details}",
      "orderDate": "${=datetime(UTC,'yyyy-MM-dd')}"
    },
    "command": "add"
  }
]

My proposal is to use some identifier to distinguish when a user would like to use dynamic values.
${dynamic.input}

Depending on the implementation, it might even be possible to use dynamic keys:
"${$.request.orders.type}": "true"

@FransVanEk
Copy link
Contributor

This is quite interesting but challenging, not per se for the discovery of the dynamic values but for the handling. Currently, the object being handled is the starting point for the values. What would be the starting point for an object with dynamic functions?

Take this command:

  {
    "path": "$.sample.demo",
    "value": "=partial(@.b,@.c.d)",
    "command": "set"
  }

It uses the @ sign to indicate that it is from this level onwards. What would we take for the starting point when having this function in a complex object? What makes sense for the user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants