Replies: 2 comments
-
I would say that it's simply that no one has ever asked for it. I don't recall seeing any requests for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
A JSON value has no information where it is located in the hierarchy. That said, to know the depth, one would need to traverse from a root element to be given by the user. There is a parent relation of the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
"Hello, I've been using the nlohmann::json library. I searched for the keyword depth in the source code but couldn't find relevant information. I noticed that there doesn't seem to be a direct way to get the depth of a JSON object. Specifically, I was looking into the json_sax_dom_parser class and didn't find an interface to retrieve the depth. Is there a built-in method to achieve this? If not, may I know the design rationale behind not including this feature? I believe having a method to get the depth could be beneficial for many use cases. Thanks for any insights!"
Beta Was this translation helpful? Give feedback.
All reactions