Skip to content

refactor: relocate ApiResponse, decouple Swagger documentation, and o… - #338

Merged
michael-whyte merged 1 commit into
mainfrom
refactor/unified_api_response
Jul 1, 2026
Merged

michael-whyte merged 1 commit into
mainfrom
refactor/unified_api_response

Conversation

@aniebietafia

Copy link
Copy Markdown
Contributor

…pen Swagger endpoints

  • Relocated the unified ApiResponse class to the package com.xtraction.api.core.web.response and corrected all global imports.
  • Extracted OpenAPI/Swagger annotations from major controllers into separate interface-based API contracts.

…pen Swagger endpoints

- Relocated the unified `ApiResponse` class to the package `com.xtraction.api.core.web.response` and corrected all global imports.
- Extracted OpenAPI/Swagger annotations from major controllers into separate interface-based API contracts.

Signed-off-by: aniebietafia <aniebietafia87@gmail.com>
@aniebietafia aniebietafia self-assigned this Jul 1, 2026
@aniebietafia aniebietafia linked an issue Jul 1, 2026 that may be closed by this pull request
7 of 12 tasks
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ CodeQL security scan failed. Please check the workflow logs.

Comment on lines +40 to +41
@Parameter(description = "Enable encryption (premium feature)")
boolean enableEncryption,
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "Profile picture deleted successfully", content = @Content(schema = @Schema(implementation = ApiResponse.class))),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "400", description = "Profile picture not found or already deleted", content = @Content(schema = @Schema(implementation = ApiResponse.class)))
})
ResponseEntity<@NonNull ApiResponse<Void>> deleteProfilePicture(UserDetails authenticatedUser, String userId);
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "Profile picture uploaded successfully", content = @Content(schema = @Schema(implementation = ApiResponse.class))),
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "400", description = "Invalid file type or empty file", content = @Content(schema = @Schema(implementation = ApiResponse.class)))
})
ResponseEntity<@NonNull ApiResponse<String>> uploadProfilePicture(UserDetails authenticatedUser, MultipartFile file, String userId);
when(userRepository.findById(userId)).thenReturn(Optional.of(sampleUser));

XtractionResponse<String> response = testClass.forceVerifyEmail(userId);
ApiResponse<String> response = testClass.forceVerifyEmail(userId);
when(userRepository.findById(userId)).thenReturn(Optional.of(sampleUser));

XtractionResponse<String> response = testClass.unlockUser(userId);
ApiResponse<String> response = testClass.unlockUser(userId);

@michael-whyte michael-whyte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is good to go 👍

@michael-whyte
michael-whyte merged commit 77eeba9 into main Jul 1, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] Unify response envelope into a single ApiResponse<T>

2 participants