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

howto get properties from json object #18

Closed
wade-fs opened this issue Oct 27, 2021 · 2 comments
Closed

howto get properties from json object #18

wade-fs opened this issue Oct 27, 2021 · 2 comments

Comments

@wade-fs
Copy link

wade-fs commented Oct 27, 2021

Hi,
For non-nested json string.....just Key=Value type...
After json unmarshel input string, how can I get the properties of json object?
My means is how to get "keys" from the json object?
Or....How to translate json to hash?
Thx.

@wade-fs
Copy link
Author

wade-fs commented Oct 27, 2021

by json_ob.keys()
Sorry...

@haifenghuang
Copy link
Owner

Yes, you are right. In the hash.go source file, you can find all the hash object's functions in CallMethod method. In fact, every object(e.g. array, hash, integer, float, string, etc.) in magpie has CallMethod method.

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