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

[CI] Swagger docs build failing #8551

Merged
merged 2 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/handlers/connections_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ func (h *Handler) GetConnectionsByKind(w http.ResponseWriter, req *http.Request,
// swagger:route GET /api/integrations/connections/status GetConnectionsStatus idGetConnectionsStatus
// Handle GET request for getting all connections status
//
// Get all connections status
// responses:
// 200: ConnectionsStatusPage
// 200: mesheryConnectionsStatusPage
func (h *Handler) GetConnectionsStatus(w http.ResponseWriter, req *http.Request, _ *models.Preference, user *models.User, provider models.Provider) {
connectionsStatusPage, err := provider.GetConnectionsStatus(req, user.ID)
obj := "connections status"
Expand Down
18 changes: 4 additions & 14 deletions server/handlers/database_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,10 @@ func (h *Handler) GetSystemDatabase(w http.ResponseWriter, r *http.Request, _ *m
// - Applies auto migration to recreate the necessary tables.
//
// responses:
// 200: successfulResponse
// 500: errorResponse

// successfulResponse: database reset successful
// A successful response indicating that the database reset operation was successful.
// ---
// type: string
// example: "Database reset successful"

// errorResponse: error response
// An error response indicating the reason for the failure of the database reset operation.
// ---
// type: string
// example: "Directory could not be created due to a non-existent path."
Copy link
Member

Choose a reason for hiding this comment

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

@Aritra8438 is this accurate?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes @leecalcote. There might be many reasons that the databse reset is not successful.
"Directory could not be created due to a non-existent path." is one of the possibilities.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, @leecalcote, I think the problem is in 200: successfulResponse considering the issue you mentioned.

I've already mentioned the successfulResponse after this, but that should be mentioned at docs.go.

What @suhail34 did is also accurate.

// 200:
// 500:

// Reset the system database to its initial state.
func (h *Handler) ResetSystemDatabase(w http.ResponseWriter, r *http.Request, _ *models.Preference, _ *models.User, provider models.Provider) {

mesherydbPath := path.Join(utils.GetHome(), ".meshery/config")
Expand Down
7 changes: 7 additions & 0 deletions server/handlers/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,10 @@ type mesheryConnectionResponseWrapper struct {
// in: body
Body models.Connection
}

// Returns all connections Status
// swagger:response mesheryConnectionsStatusPage
type mesheryConnectionsStatusPage struct {
// in: body
Body *models.ConnectionsStatusPage
}
2 changes: 1 addition & 1 deletion server/handlers/events_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
// Listens for events across all of Meshery's components like adapters and server, streaming them to the UI via Server Side Events
// This API call never terminates and establishes a persistent keep-alive connection over which `EventsResponse`s are pushed.
// responses:
// 200: EventsResponse
// 200:

// EventStreamHandler endpoint is used for streaming events to the frontend
func (h *Handler) EventStreamHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, _ *models.User, p models.Provider) {
Expand Down