Skip to content
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

Add Endpoints Documentation with rswag #194

Merged
merged 15 commits into from
Nov 12, 2023

Conversation

juanarias93
Copy link
Collaborator

@juanarias93 juanarias93 commented Oct 25, 2023

What && Why

Add Swagger-based rswag gem for documenting BE endpoints.

Disclaimers / Extra comments

  • Documentation will be accessible via UI on: http://localhost:3000/api-docs (or for example on https://finder-backend-qa.onrender.com/api-docs for the QA environment).

  • Run SWAGGER_DRY_RUN=0 RAILS_ENV=test rails rswag in order to re-generate the swagger.json file.

  • Important: Generated documentation takes into account only the success scenarios, enough for hitting the application endpoints properly. Eventually, the rest of the tests/docs can be added, if needed.

  • Coverage was not affected, since this only added some extra specs under spec/api/ for the endpoints documentation. We're still at 98.45%.

How

  • Add rswag gem.
  • Setup/install the gem.
  • Update Readme with new URL where endpoint documentation can be found.
  • Add new tests under spec/api/ for all controllers.
  • Re-generate swagger.json file with all endpoint's docs.

Links

How to Review

  • Review commit by commit recommended.
  • Review all at once recommended.

Screenshots

Screenshot 2023-11-10 at 8 54 57 PM

Screen-recording

Screen.Recording.2023-11-10.at.8.55.44.PM.mov

@juanarias93 juanarias93 changed the title Add Endpoints Documentation with rswag [DRAFT] Add Endpoints Documentation with rswag Oct 25, 2023
@juanarias93 juanarias93 changed the title [DRAFT] Add Endpoints Documentation with rswag [WIP] Add Endpoints Documentation with rswag Oct 25, 2023
@juanarias93 juanarias93 marked this pull request as draft October 31, 2023 22:57
@juanarias93 juanarias93 force-pushed the juan_arias--add_endpoints_documentation branch 6 times, most recently from 28fdf6d to 057aa2e Compare November 8, 2023 21:28
@juanarias93 juanarias93 force-pushed the juan_arias--add_endpoints_documentation branch from 91a0045 to 8ca4c79 Compare November 11, 2023 17:26
@juanarias93 juanarias93 marked this pull request as ready for review November 11, 2023 17:29
@juanarias93 juanarias93 changed the title [WIP] Add Endpoints Documentation with rswag Add Endpoints Documentation with rswag Nov 11, 2023
Copy link
Collaborator

@andresconti andresconti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blind approve

@juanarias93 juanarias93 merged commit f82ff1c into develop Nov 12, 2023
1 check passed
@juanarias93 juanarias93 deleted the juan_arias--add_endpoints_documentation branch November 12, 2023 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants