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: Jsonata json type inference #690

Open
rmanibus opened this issue May 6, 2024 · 5 comments
Open

Feature: Jsonata json type inference #690

rmanibus opened this issue May 6, 2024 · 5 comments

Comments

@rmanibus
Copy link

rmanibus commented May 6, 2024

It would be great if on top of transforming data, Jsonata was also able to transform the schema of the data.

I have been experimenting a little bit, and it is fairly straight forward to re-use the same AST but to modify the evaluation function to work on a Json Scheme instead of a Json payload.
we would then have:

expression -> AST
evaluateJson(AST, jsonInput) -> jsonOutput
evaluateSchema(AST, jsonSchemaInput) -> jsonSchemaOutput

@brentshulman-silkline
Copy link

This seems interesting. Can you give me a practical example to help me (potential JSONata user) understand a bit more?

@rmanibus
Copy link
Author

rmanibus commented May 7, 2024

Sure !
Imagine a solution where users can author jsonata expressions.
Given the input type is well defined, this feature would allow to infer the output type dynamically and show it on screen. It would also allow to advertise the type for consumption in another expression or any other system.

@brentshulman-silkline
Copy link

Oh, I think that would be super helpful. Thanks for the explanation!

@brentshulman-silkline
Copy link

Any luck pushing this forward?

@rmanibus
Copy link
Author

I started to look into it, I have some basic examples working

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

No branches or pull requests

3 participants