Skip to content

Are nested objects supported in a lens selector? #224

Answered by yamafaktory
zkxs asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zkxs,

Thanks for your feedback!

Indeed this is not possible in the current state of jql since a Lens is basically a tuple of key (str) + LensValue (a JSON primitive):

pub struct Lens<'a>(pub(crate) &'a str, pub(crate) Option<LensValue<'a>>);

pub enum LensValue<'a> {
/// Variant for a JSON boolean.
Bool(bool),
/// Variant for JSON null.
Null,
/// Variant for a JSON number.
Number(usize),
/// Variant for a JSON string.
String(&'a str),
}

To make it work, I'll need to refactor the parser imp…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zkxs
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants