HackYourFuture-CPH / FP-class11

Class11 Final Project - A collaboration between HYF and Seasony
MIT License
5 stars 8 forks source link

Feature/swagger autodocs #184

Closed ricardoaguiar closed 4 years ago

ricardoaguiar commented 4 years ago

Resolves issue #170

Issue: merge conflicts on sawgger.json file

Propose solution:

  1. Use swagger-jsdocs to auto-generate API documentation from code comments.
  2. Researched and formatted JSON to YAML format to comply with OpenAPI specification
  3. Checked the documentation for each endpoint
  4. Implemented documentation for all the endpoints

Open items from the above work:

  1. Firebase authentication is not behaving as expected
  2. Re-check all the documentation to make sure is correct (an extra set of eyeballs is always helpful)
  3. Research the Bearer and oauth2 authentication to comply and make it work with OpenAPI 3.0.0 (or the current version in place)

After pulling the branch, make sure to run npm install to update the package.json files with the modules for this branch.

ricardoaguiar commented 4 years ago

They are groped by what the endpoint returns. For example all the batches endpoints are grouped together. There is a default values group with two endpoints, but I'm not sure if they should be together. Swagger-JsDocs automatically order them alphabetically, but the Default Values is on top. I think Swagger renders that way "whatever is default goes to the top" of the stack.

zkwsk commented 4 years ago

Hey @ricardoaguiar,

Just discussed this one with @dpfernandes. Let's wait merging this until after the presentations wednesday. It is not going to make a huge change this late in the project and it may cause a lot of merge conflicts for the other ongoing PRs. Your work is not wasted, though. We will merge it after and hopefully it will help make it easier to keep developing the project in the future and we will also make sure to migrate your work into our boilerplate project meaning that this is how we will run Swagger in the next project, so your effort is very much appreciated 🙏

dpfernandes commented 4 years ago

Approved