You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the Swagger tag from Auth to Mixin may reduce discoverability of authentication endpoints. Confirm this re-grouping is intentional and consistent across the docs.
@ApiBearerAuth() is added; ensure all protected routes in this controller actually require JWT and that public routes (if any) are excluded or documented appropriately.
Only dbhealth is annotated with @ApiBearerAuth() while other health endpoints remain public; validate intended exposure and align guards and docs for consistency.
asyncgetHealthByExchange(@Param('name')name: string){returnthis.healthService.getExchangeHealth(name);}
@Get('dbhealth')
@ApiOperation({summary: 'Get DB health status'})
@ApiResponse({status: 200,description: 'Health of Database , OK | ERROR'})
@ApiResponse({status: 400,description: 'Bad Request'})
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)asyncgetDbHealth(){
Latest suggestions up to 3e390f5
Explore these optional code suggestions:
Category
Suggestion
Impact
Possible issue
Remove auth from health probe
Requiring auth for a health probe can break liveness/readiness checks in deployments where probes cannot set Authorization headers. Expose DB health without JwtAuthGuard or provide a separate unauthenticated endpoint for probes.
@Get('dbhealth')
@ApiOperation({ summary: 'Get DB health status' })
@ApiResponse({ status: 200, description: 'Health of Database , OK | ERROR' })
@ApiResponse({ status: 400, description: 'Bad Request' })
-@ApiBearerAuth()-@UseGuards(JwtAuthGuard)+async getDbHealth() {+ return await this.healthService.checkDbHealth();+}
Suggestion importance[1-10]: 7
__
Why: This accurately targets the newly added @ApiBearerAuth() and @UseGuards(JwtAuthGuard) on dbhealth, noting potential deployment issues; impact depends on environment but is a solid operational consideration.
Medium
General
Restore correct Swagger tag
The tag change from 'Admin' to 'Mixin' can misclassify admin-only endpoints in Swagger and hinder discoverability. Keep a distinct tag for admin endpoints to avoid confusion and maintain proper grouping.
Why: The suggestion correctly identifies the tag change to Mixin and proposes reverting to Admin to preserve clear Swagger grouping; it's a reasonable maintainability/usability improvement with moderate impact.
Low
Clarify admin-only Swagger grouping
These endpoints are described as admin-only but now use a broad 'Mixin' tag, which obscures their purpose and may mislead consumers about required permissions. Use a specific tag to clearly denote admin-only exchange operations.
// This API is used for admin page to do rebalance
-@ApiTags('Mixin')+@ApiTags('Admin')
@Controller('exchange')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
Suggestion importance[1-10]: 6
__
Why: The code is described as admin-only and the suggestion to use an Admin tag improves Swagger clarity without changing behavior; it's contextually accurate and moderately beneficial.
The route is now annotated with @ApiBearerAuth() but lacks an explicit 401/403 response in Swagger, reducing clarity for consumers. Document auth failure responses to match the new bearer requirement.
Why: Adding 401/403 Swagger responses aligns docs with the introduced @ApiBearerAuth() and JwtAuthGuard, improving API clarity though it’s a documentation enhancement.
Medium
Restore correct Swagger tag
Changing @ApiTags from 'Admin' to 'Mixin' may miscategorize admin-only endpoints in Swagger, making them hard to locate and potentially confusing for consumers. Keep admin endpoints under a distinct tag to reflect their purpose.
Why: The PR changes @ApiTags from Admin to Mixin, which can miscategorize admin endpoints; reverting to Admin improves API discoverability and organization without altering behavior.
Low
Use precise Swagger tag
Retagging admin-only exchange operations as 'Mixin' may hide critical admin endpoints under a generic tag, hurting API discoverability. Keep a specific tag that reflects admin scope to avoid misuse and confusion.
// This API is used for admin page to do rebalance
-@ApiTags('Mixin')+@ApiTags('Exchange')
@Controller('exchange')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
Suggestion importance[1-10]: 6
__
Why: Replacing the generic Mixin tag with Exchange better reflects the controller’s scope and aids consumers; the change is correct and improves API organization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Description
Standardize ApiTags and add ApiBearerAuth where necessary
Summary of changes
Created Mixin ApiTag to join all Mixin endpoints and add ApiBearerAuth to all endpoints that require it
How to test the changes
Run API and check swagger.
Related issues
None
PR Type
Documentation
Description
Standardize Swagger ApiTags capitalization
Group multiple controllers under
MixinAdd ApiBearerAuth to protected endpoints
Exclude root controller from Swagger
Diagram Walkthrough
File Walkthrough
16 files
Exclude root controller from Swagger docsRetag admin controller under Mixin groupRetag auth controller to MixinCapitalize Marketdata Swagger tagCapitalize Grow Swagger tagCapitalize Health tag and secure DB healthCapitalize Marketdata Swagger tagCapitalize Exchange Swagger tagRetag to Mixin and add bearer authRetag to Mixin and add bearer authRetag to Mixin and add bearer authAdd tags and bearer auth to usersAdd Performance Swagger tagCapitalize Spotdata Swagger tagCapitalize Strategy Swagger tagCapitalize Trade Swagger tag