omgnetwork / ewallet

eWallet Backend for the OmiseGO SDKs.
https://omisego.network/
Apache License 2.0
324 stars 74 forks source link

Add version number in the root endpoint #562

Closed kartsims closed 5 years ago

kartsims commented 5 years ago

Subject of the issue

I would like to be able to retrieve the API version from the root endpoint

Steps to reproduce

Access http://localhost:4000/api/admin

Expected behavior

There is a version parameter in the response of each request, it would also be good to have it in the root endpoint, something such as :

{"success":true,"version":"1"}

This could be useful for 3rd party libraries implementing this SDK, to be able to know from the get go if the API base URL is compatible with the client's implementation

Actual behavior

root endpoint returns :

{"success":true}
T-Dnzt commented 5 years ago

The version in the responses are for the API version being used, which depends on the content of the Accept header, for example: application/vnd.omisego.v1+json.

From what I understand, what you're suggesting is to show the ewallet_version in the root endpoint which is a good idea, we'll add it.