-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add function to parse an escaped JSON string #825
Comments
@skayliu thank you for raising it. I agree that parsing a JSON string into a FEEL value would be useful. I saw similar requests before. 👍 I updated the issue description and proposed a new built-in function. Please have a look if the examples match your requirements. The issue of parsing a JSON string is closely related to the revert function of creating a JSON string from a FEEL value: #602. |
@saig0, which libray would you like to support this feature? |
@skayliu we could implement the JSON parser ourselves, similar to the FEEL parser. There is an example here. Or, we use Jackson library. We use the library already in Camunda 8. It could be fun writing the parser ourselves and we don't need a new library for it. If it doesn't work or is too complicated then we should switch to Jackson. |
For the sake of NIH I would recommend we go with Jackson as its already a proven solution in this space. |
Hi @saig0 - is this scheduled in any way? Also stumbled upon this - especially in the context of AI results that often encode Json as a String. JSON.parse would be super helpful. I think we should definitely rely on Jackson for doing it! |
@berndruecker thank you for your input. Currently, the function is not scheduled for any release. |
Now that DMN 1.6 finally standardized the FEEL-JSON mapping it would be a logical next step to add it as a FEEL conversion function in DMN 1.7. |
As a workaround for flat JSON objects with only string values one can build something with string functions and the
Full Example in FEEL Playground Using our |
Is your feature request related to a problem? Please describe.
When use the REST connector to call a service, i got the response like below.
Now i need to extract the
taskTodoList
into an array to the result expression.As discuss in the forum:
How to get the taskTodoList from the response body
Parse a json string to FEEL context
Describe the solution you'd like
A new built-in function to handle the JSON string like
JSON.parse()
.Related issues
The text was updated successfully, but these errors were encountered: