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

Add helpers for recursively looking up things in ujson.Value #643

Open
lihaoyi opened this issue Dec 3, 2024 · 1 comment
Open

Add helpers for recursively looking up things in ujson.Value #643

lihaoyi opened this issue Dec 3, 2024 · 1 comment

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Dec 3, 2024

Right now you have to do stuff like

json.objOpt.flatMap(_.get("value")).flatMap(_.objOpt).flatMap(_.get("worker")).nonEmpty)

whereas I'd like to be able to write something like

json.resolve("value", "worker").nonEmpty
@plokhotnyuk
Copy link
Contributor

@lihaoyi What do you think about using of Scala dynamic types for that?

Please see how it is done in the dijon library: https://github.com/jvican/dijon

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