Open davidyuk opened 4 years ago
I agree with the general idea that we need to streamline the API naming and come up with a proper convention but we should check our priority on this as it will require changes in all connected clients as well.
As an endpoint consumer, I don't care if it a source of truth or it caches some third-party data source
I think in blockchain you should care, this makes clear its a cached representation of some data, espectially NOT the source of truth
Combine /static/stats and /cache/stats into just /stats
we can do, this did happen initially as for static the source is the db and for cache the source is the contract
Sending a POST request to claim endpoint already means submitting some data.
I'd not change that, as its submitting a claim try, not directly claiming
I think in blockchain you should care, this makes clear its a cached representation of some data, espectially NOT the source of truth
I'm still thinking that it can be just documented instead. More arguments around this:
cache
in a path can break REST in cases if we have an entity that is cached and the user may ask backend to modify it
cache
prefix rudimentaryI'd not change that, as its submitting a claim try, not directly claiming
I don't see the difference, claiming can fail isn't it the same as submitting a claim try?
Drop
static
from endpoint namesActually, I just can't understand what it means in this context.
Drop
cache
from endpoint namesAs an endpoint consumer, I don't care if it a source of truth or it caches some third-party data source (for example,
cache/prices
endpoint). Also, it is obvious that we are working with cached data if we are fetching something that is already presented in a smart contract. Maybe we can explain that these endpoints caching in the documentation instead?Unclear and inconsistent usage of
api
I assume that all endpoints are kind of
api
, but currently, it is used inblacklist/api/wallet
andcomment/api/...
, I don't see any collisions or misunderstoodnes if we just removeapi
from that endpoint names.Combine
/static/stats
and/cache/stats
into just/stats
In
superhero-ui
they are queried at the same time. In general, I don't see reasons to split these endpoints.Rename
claim/submit
toclaim
Sending a POST request to
claim
endpoint already means submitting some data.Rename
profile/image/:address
toprofile/:address/image
To have it consistent with
profile/:address
endpoints.Rename
cache/userStats?address=:address
toprofile/:address/stats
The same as the above.