NebulousLabs / skynet-docs

Beautiful static documentation for your API
https://spectrum.chat/slate
Apache License 2.0
3 stars 5 forks source link

Methods should return full API responses #6

Closed mrcnski closed 4 years ago

mrcnski commented 4 years ago

All SDKs should have methods that wrap the siad API endpoints, and thus return similar responses as if you were to execute a curl command.

I would then wrap those in more human readable / friendly functions. This would allow SDK users to access our API in a 1-1 fashion.

This will be a breaking change.

peterjan commented 4 years ago

Definitely low priority this one. Also not necessarily breaking if we have a convention that appends _raw or w/e to the current interface, e.g. upload_file_raw.. Actually I think python already has _request, right? Perhaps we can just use that.

In any case I would not add this just yet. One of the things bothering me with the SDKs is the difference in output, where one returns a url on upload, the other a skylink. We should start with fixing just that.. of 3 return a skylink and 1 a url, then let's start with having that one sdk also return a skyink on that call.

These would indeed be breaking changes though...

mrcnski commented 4 years ago

Luckily the breaking changes will be minimal. curl and skynet-js return the full response objects but the rest already return full URIs (URI prefix + skylink):

curl: full object
CLI: uri
Go:  uri
skynet-js: full object
nodejs-skynet: uri
python: uri
  1. [ ] I want to expose request functions like in Python that allow getting the full response data.

  2. [ ] For skynet-js, the existing functions should be changed to return the full uri -- this will be a breaking change, and should be done sooner rather than later.

  3. [ ] There should also be a note or section in the docs mentioning how to get an identical response to what is returned by curl.

mrcnski commented 4 years ago

Will do this in all SDKs soon since we're already breaking compat with the client model refactor.