sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
11 stars 39 forks source link

Add Swagger API documentation #133

Closed dsmabulage closed 3 months ago

dsmabulage commented 3 months ago

Description: Implement Swagger API documentation for the backend to provide a clear, interactive, and standardized way to document and test the API endpoints.

Tasks:

  1. Install and configure Swagger dependencies.
  2. Set up Swagger configuration in the project.
  3. Annotate existing API endpoints with Swagger annotations.
  4. Generate Swagger documentation automatically from the annotations.

Acceptance Criteria:

Additional Information: Add additional information

Related Dependencies or References: Add related dependencies and references relating to the implementation.

pswarlock commented 3 months ago

Hi @dsmabulage Went through your issue and in order to implement swagger we have to annotate each endpoint with quite a lengthy comment like this.

/**
 * @swagger
 * /getAccessToken:
 *   get:
 *     summary: Get access token
 *     description: Retrieve an access token from the API.
 *     responses:
 *       200:
 *         description: Access token retrieved successfully.
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 access_token:
 *                   type: string
 */

Depending on the parameters accepted in the endpoint, possible responses, the length of this may vary.

Is there a better way to approach this?

dsmabulage commented 3 months ago

I think this will be an unnecessary burden. I will close this