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

object response to array #57

Open
TwinMist opened this issue Oct 16, 2020 · 2 comments
Open

object response to array #57

TwinMist opened this issue Oct 16, 2020 · 2 comments

Comments

@TwinMist
Copy link

Hi
could there be a built in function to turn the object response into a array or multidimensional array with keys

thanks

@TwinMist
Copy link
Author

HI
what is the best way to achieve this?

@cwmiller
Copy link
Owner

It's not a very easy task. I thought maybe it could just be done by casting the response object as an array, but that doesn't work because all the fields are private.

The only way I can think of right now is to write something using reflection that calls all the getter methods on the response object to get all the field values. I may be able to implement some kind of asArray extension onto all the response objects to do this, but I'll have to mess with it some to see if it's doable.

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