Seeed-Studio / Wio_Link

Wio_Link 8266
http://seeed-studio.github.io/Wio_Link/
182 stars 64 forks source link

add swagger.io api description to server.py #33

Closed dothebart closed 8 years ago

dothebart commented 8 years ago

You've got a nice api description, however it always will list your server. If one tries to cut'n'paste the examples one has always to replace the hostname.

A http://swagger.io api description could be shipped alongside the server.py and be served by it. You then can talk to your local server.py, and directly test stuff.

Aside of that you can generate client stubs directly from the API. We use swagger.io with ArangoDB for our API, and get lots of positive feedback for it: https://raw.githubusercontent.com/arangodb/arangodb/devel/js/apps/system/_admin/aardvark/APP/api-docs.json

You can also use the swagger editor with the compacter yaml representation for interactive editing.

I've tried to hook my wio link to my own server.py, but currently struggling with the procedure of authenticating and getting data from it?

KillingJacky commented 8 years ago

If you deploy a private server, the hostname can be configured in config.py, with this done, the hostname in api description can be displayed as your configuration.

dothebart commented 8 years ago

Its still somewhat problematic to get the curl strings from the device to the main machine (which is Why I think its a good idea to also have the documentation there) or is there a better way to get these commandlines other than typing it into the terminal one by one?

KillingJacky commented 8 years ago

you can use the share icon up-right corner to send the ref page to computer.