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

[BE] Researching and implementing use of Swagger #60 #64

Merged
merged 19 commits into from
Jun 26, 2023

Conversation

GabrielaMaureira
Copy link
Collaborator

In this pull request, I made the research and implemented Swagger.

Before starting to document the api in the project, I worked on the swagger editor, to see how it worked. Once I had a general idea of ​​what I needed, I applied all that in the project.

  • I installed Swagger in the project following the instructions from the repository (https://github.com/DarkaOnLine/L5-Swagger/wiki/Installation-&-Configuration).

  • Next, I started with the comments for the user login and registration. Once that was done, I commented on the controllers responsible for the App and Faq resources.

  • After that, I documented the used models, making it easy to quickly access the schemas.

  • Lastly, I added security to the endpoints. In a simple manner, using the Passport token returned upon login, you will need to enter it in the top-right corner as 'Bearer ckzjdnfdruYdkjnfkj...'.

  • Apart from being able to understand the API endpoints, resources, and their models, you will also be able to test them using a Postman-like style.

To have access to this, you just need to know this route: /api/documentation.

If somebody wants to learn about Swagger and how it works, links below:

  1. https://sathyaventhan.medium.com/laravel-secure-rest-api-with-swagger-26050dafa55
  2. https://swagger.io/docs/specification/basic-structure/
  3. https://blog.quickadminpanel.com/laravel-api-documentation-with-openapiswagger/
  4. https://editor.swagger.io/

@CloudSalander
Copy link
Collaborator

Amazing work, Gaby.

Your partners(me included) will really appreciate the amount of knowledge that you shared with us on this feature :)

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.

[BE] Researching use of Swagger
2 participants