-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: swagger doc and definition for GET buildings #1308
Comments
@tomalrussell the libraries are https://www.npmjs.com/package/typescript-rest and https://www.npmjs.com/package/typescript-rest-swagger - they aren't hugely popular right now so might be something to consider. I have used them in a couple projects |
Thanks @mz8i - looks like https://www.npmjs.com/package/tsoa is in the space and may be worth evaluating too. Can you evaluate options and put together a proof of concept? By default, I'd be cautious about adding dependencies and might prefer just using the swagger codegen to stub out methods and generate static HTML UI. I'm happy to look at what's available, though, and keen to see some running code that we can test out, The key goals as far as I see it are:
|
So far the differences I can see are:
It is worth noting that using any of the above relies on #348 (switching to TypeScript) - so that needs discussing and potentially implementing first. The alternatives would be:
|
I do like the sound of swagger-jsdoc: seems pretty pragmatic, relatively quick win option. I think the API should never grow too big, so not too too worried about keeping it consistent - the main thing will be keeping on top of building attributes as we fill out the remaining sections. So, suggest:
|
I started out with moving out the buildings API code into a routes file and a controller file to decrease the size of I also manually created an initial openapi.yml (Swagger is now called OpenAPI) file with the specification of some of the endpoints: mz8i@bd1645c Some thoughts:
Any comments welcome, otherwise I will continue describing the other endpoints and possibly refactoring. |
@matkoniecz can you close? |
Depends on whether we want to have documentation of API and plan to spend time on that. Good documentation would be useful for more automated edits. |
@matkoniecz shall I move to core then for discussion with international group? |
yes |
Initial setup and documentation for the core buildings API call:
GET /buildings/<building_id>
currently implemented in https://github.com/tomalrussell/colouring-london/blob/ad77e8345c4ae526a38592af8ea799f6d39c8b15/app/src/server.js#L194-L195GET /buildings
not currently implemented - will need pagination!Resources
@mz8i do you have a link for the typescript-swagger tool you mentioned earlier?
The text was updated successfully, but these errors were encountered: