Skip to content

Conversation

@timbastin
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 11, 2026 11:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive OpenAPI 3.1 specification documentation to the devguard API. The PR includes Swagger/OpenAPI annotations throughout the codebase and generates a complete swagger.yaml specification file.

Changes:

  • Added OpenAPI annotations to all controller endpoints (60+ endpoints documented)
  • Enhanced data model annotations with proper swagger types for date fields
  • Configured security definitions for CookieAuth and ApiKeyAuth
  • Added Makefile target for regenerating documentation

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/swagger.yaml Generated OpenAPI 2.0 specification with 4209 lines covering all API endpoints
router/session_router.go Added @summary, @Security, and @success annotations for whoami endpoint
dtos/dependency_vuln_dto.go Added swaggertype and format tags for CISA date fields
database/models/cve_model.go Added swaggertype and format tags for CISA date fields in CVE model
controllers/*.go (15 files) Added comprehensive OpenAPI annotations for all controller methods
cmd/devguard/main.go Added security definitions for CookieAuth and ApiKeyAuth
Makefile Added docs target to regenerate OpenAPI specification using swag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 123 to 128
// @Summary Create webhook integration
// @Security CookieAuth
// @Security ApiKeyAuth
// @Param body body object true "Webhook data"
// @Success 200 {object} dtos.WebhookIntegrationDTO
// @Router /webhooks [post]
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The OpenAPI annotation comment is placed after the closing brace of the previous function rather than immediately before the function it documents. This creates a disconnect between the documentation and the function, making the code harder to maintain. The comment block should be moved to appear directly before the Save function declaration.

Copilot uses AI. Check for mistakes.
@timbastin timbastin merged commit deac95a into main Jan 12, 2026
9 checks passed
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