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

Autocompletion for returned json data #2

Open
dongilbert opened this issue Mar 5, 2014 · 3 comments
Open

Autocompletion for returned json data #2

dongilbert opened this issue Mar 5, 2014 · 3 comments

Comments

@dongilbert
Copy link
Contributor

See conversation here:

http://www.reddit.com/r/PHP/comments/1zix9k/github_api_client_feedback_welcome/cfuym7r

@elkuku
Copy link
Contributor

elkuku commented May 6, 2014

Damn, I forgot to watch this repo, sorry for the late response....
Some time ago I was experimenting with creating some abstract classes that contain the properties for the returned json data.
Those classes can be generated using this file that contains all the return objects and their properties:
https://github.com/github/developer.github.com/blob/master/lib/resources.rb

I think that's doable 😉

@dongilbert
Copy link
Contributor Author

I helped flesh out a Stripe PHP API where we had value objects for the returned json data. It uses JMSerializer and Doctrine Annotations to fill the value object, and it gives you nice camelCased method names instead. :P

I think we can do something like this - https://github.com/jlinn/stripe-api-php/tree/master/src/Response

@elkuku
Copy link
Contributor

elkuku commented May 6, 2014

Looks like a nice concept. As far as I can see, it would require passing the class name to our processResponse() method so the JSON data can be properly deserialized. (I didn't knew about the serializer script - I think it is the JM_S_Serializer? - nice)

CamelCase properties also look better then under_scored ones in the PHP world. The only concern I have here is that we would move away from the GitHub API and it's wonderful documentation and, of course, there will be a huge b/c break..

What about a "simple" auto complete using dumb classes with public properties which are used only as the return type in the method doc blocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants