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

Path lookup syntax #50

Closed
abdullah2993 opened this issue Feb 21, 2022 · 2 comments
Closed

Path lookup syntax #50

abdullah2993 opened this issue Feb 21, 2022 · 2 comments

Comments

@abdullah2993
Copy link

What is the difference between $body.some.path vs $.body.some.path?

@solomon-b
Copy link
Contributor

solomon-b commented Feb 21, 2022

When you run the kriti interpreter you provide a mapping of variables to JSON values which are in scope for the kriti template:

runKriti :: Text -> [(Text, Value)] -> Either KritiErr Value

In your examples, $body and $ are both variables that are being assigned to a JSON object.

In each respective case they might something like:

$body = { "some": { "path": "foo"}}
$ = { "body" {"some": {"path": "foo"}}}

@abdullah2993
Copy link
Author

Thanks

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