-
Posts
6 -
Joined
-
Last visited
Posts posted by ZeraZerg
-
-
Quote
Frontend applications and API specifications are open-sourced, backend is not.
What do you mean?
QuoteIt is not recommended and in most cases not supported to have a request body in a GET request. Since you are sending a JSON to that endpoint, it should use POST. This is basics of web development and semantics.
Yes I know, that but the point is that the resource POST /api/auctions/:page/:number with the body could be simply converted as query parameters this way:
-
/api/auctions/:page/:number ==> /api/auctions?page=1&resultsPerPage=1
- Reason: the resource you are waintg to retrieve is "auctions", not the "number"
- Also change "number" to "resultsPerPage", which is more clear as user. Can set a defalut number of "30" or just make it mandatory.
- You can make "page" it mandatory giving a 4XX error and feedback.
-
input ==> cardName. Query param also
-
Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed
-
Optional
-
-
min ==> minBfpPrice. Query param also
-
Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed
-
Optional
-
-
max ==> maxBfpPrice. Query param also
-
Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed
-
Optional
-
Having this all together the
"POST /api/auctions/:page/:number" + "Body" can be a simple"GET /api/auctions?page=1&resultsPerPage=1&cardName=Master Archers&minBfpPrice=12&maxBfpPrice=30000" and no Body is required
This being told, I don't want to make enemies but to give feedback as person that wants to use this and finds it usable, but not mostly correct. I find this approach clearer and easily expandable wityh more filters in the future if it's required.
If it's a problem of change it, give me access to a feature branch and I gladly will make the changes and send de merge request (logically the final decison will be yours to apply it)
QuoteI highly doubt you found many other errors cause I have no problems running any of the applications, be it frontend or backend, locally or on a VPS. You might have found some misstypes or inconsistencies, but I hardly doubt you found errors per se. All reports and suggestions are welcome here: https://github.com/fiki574/Skylords-Reborn-API-UI/issues
I'll post the same on the issues page from github, I just wanted to give a more direct developer-friendly response.
Thank you for your hard work,
fellow Skylord.
fiki574 likes this -
/api/auctions/:page/:number ==> /api/auctions?page=1&resultsPerPage=1
-
Me too, it would be awesome
-
I've found some inconsistencies in the API signature...
This endpoint https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#post-apiauctionspagenumber is a POST and it should be a GET because you are retrieveing information and is the auction state do not change it should be idemponent.
- Why is a POST?
Also...
- This API is opensource or restitrcted to verfied developers?
Also I've found many other errors that would like to discuss or at least notify, but this post wolud be too long and boring ^.^'
Patch #400021 - 31 December 2020
in Updates
Posted
I see it nice, ty devs