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

Deserialize #1366

Closed
Akirame opened this issue Nov 21, 2018 · 4 comments
Closed

Deserialize #1366

Akirame opened this issue Nov 21, 2018 · 4 comments
Labels
kind: question state: needs more info the author of the issue needs to provide more details

Comments

@Akirame
Copy link

Akirame commented Nov 21, 2018

There's a way to deserialize a Json file to a Json object? i have a json file that contains data and i need to read that

@nlohmann
Copy link
Owner

Please have a look at the project‘s README file. It is all explained there.

@Akirame
Copy link
Author

Akirame commented Nov 22, 2018

Sorry for the question, i have this Json, how can i do to refer to "layers","height"? i tried
json j["layers"]["height"] and i cant retrieve that data, thank you

"height":32, "infinite":false, "layers":[ { "height":32, "id":1, "name":"Tile Layer 1", "opacity":1, "type":"tilelayer", "visible":true, "width":32, "x":0, "y":0 }],

@gregmarr
Copy link
Contributor

layers is an array, so for this example you need j["layers"][0]["height"].

@nlohmann
Copy link
Owner

@Akirame Did @gregmarr 's answer fix the issue?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

3 participants