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

There isn't a uuid() function for JSONata #672

Open
dubnemo opened this issue Feb 12, 2024 · 2 comments
Open

There isn't a uuid() function for JSONata #672

dubnemo opened this issue Feb 12, 2024 · 2 comments

Comments

@dubnemo
Copy link

dubnemo commented Feb 12, 2024

#390 discusses the challenge, but the core issue was solved therefore that could be closed an a new issue to focus on that be created.

The use case: while iterating in a map, a new uuid needs to be generated and assigned to a property for each array entry.

@ipauler
Copy link

ipauler commented Feb 15, 2024

Maybe it's not what you're looking for, but you can register your own function for your expression.
We're using that a lot for our use case, we have a library of functions we're using, all of them are pre-registered before running evaluation.
https://docs.jsonata.org/embedding-extending#expressionregisterfunctionname-implementation-signature

@dubnemo
Copy link
Author

dubnemo commented Feb 15, 2024

@ipauler the intent of this ticket is to build this function in the core of JSONata. Most transformation languages I have worked with have similar functions built-in.
E.g., DataWeave does this now:
https://docs.mulesoft.com/dataweave/latest/dw-core-functions-uuid
That is only one of many. The recommended goal is to make JSONata more 'enterprise-grade'.

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