schmorrison / Zoho

Golang API for Zoho services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO

schmorrison opened this issue · comments

  • Writing units tests
    • setup http client and server for mocking endpoints and responses
    • provide extremely simple way for contributors to provide an endpoint unit test
  • Add a map[string]interface{} to response structs and decode JSON into it as well as the root struct
    • this could be a field, accessed as normal, or an embedded struct that provides methods for accessing the decoded values
  • Write a different TokenLoaderSaver interface example because AppEngine subpackages have been deprecated AFAIK
  • Research Zoho docs to find all the possible HTTP request body encoding formats.
  • Figure out how to allow users to add custom fields in responses/requests. This may require embedding structs in a different way.

Please create a new issue if you decided to work on these.

@schmorrison I will pick first thing first, Writing unit tests. Will start with Zoho expense api to add unit tests for it. PR should contain support added + new unit tests. Hope to complete it soon.

@ashishsnigam Any progress on this? If I have some time this weekend I could review what you have, or I could take a run at it if you haven't got a start yet.

@schmorrison I am still not able to start working on it due to time crunch but I hope to start working on it October onwards only. Sorry for it.

@ashishsnigam I've just pushed some testing stuff, I never tried on a data endpoint but did test on the OAuth endpoints. You should be able to write a test for a specific endpoint pretty simply , it won't actually send the request to Zoho but we can test the marshal/unmarshal body, authentication, etc.

If you want an example let me know, but it should be pretty straightforward. You can check oauth_test.go for how I tested to OAuth endpoints with the current test struct.

@schmorrison Thanks. Will try to check it out soon but too busy with day job.

  • Create a http handler that simplifies catching OAuth redirect when not a localhost address.