Skip to content

Reading json array-like but not array #2433

Answered by gregmarr
tawmoto asked this question in Q&A
Discussion options

You must be logged in to vote

There is no array in that JSON. Arrays are marked with [] characters. You just have objects and strings.

The first loop you posted is the proper way to loop over JSON objects when you need to know the keys. Why are you trying to remove .items() and key/value?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tawmoto
Comment options

Answer selected by nlohmann
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