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

allow interpolator to read arrays/nested #159

Merged
merged 6 commits into from
Dec 21, 2022

Conversation

kmerfeld
Copy link
Contributor

should fix #102

src/interpolator.rs Outdated Show resolved Hide resolved
@fcsonline
Copy link
Owner

Great addition! Thanks! 👏

@fcsonline
Copy link
Owner

Can you add some examples into the main readme?

@fcsonline
Copy link
Owner

I just fixed some clippy offenses. Can you rebase from master?

kmerfeld and others added 4 commits December 19, 2022 01:13
@kmerfeld kmerfeld force-pushed the allow_interpolation_of_arrays branch from 684cbcc to f4f2f56 Compare December 19, 2022 01:22
kmerfeld and others added 2 commits December 19, 2022 01:22
Added some extra code to cover more cases in the new interpolator
mechanism. Also, fixing some clippy offenses too.
@fcsonline
Copy link
Owner

I took the opportunity to fix some issues that I detect and also added an example in the documentation.

It looks fine now! 👌

context.insert(String::from("Array"), json!(["a", "b", "c"]));
context.insert(String::from("Object"), json!({"this": "that"}));
context.insert(String::from("Nested"), json!({"this": {"that": {"those": [{"wow": 1}, {"so": 2}, {"deee": {"eeee": "eeep"}}]}}}));
context.insert(String::from("ArrayNested"), json!([{"a": [{}, {"aa": 2, "aaa": [{"aaaa": 123 }]}]}]));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not working properly.

@fcsonline
Copy link
Owner

Merging! Thanks for this great contribution!

@fcsonline fcsonline merged commit a00b30c into fcsonline:master Dec 21, 2022
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

Successfully merging this pull request may close these issues.

How to get a single field inside an array of assign?
2 participants