Skip to content

Commit 799637b

Browse files
fix: resolve double api/v1 prefix in route paths
Signed-off-by: mohamed-ben-khemis <[email protected]>
1 parent 22fc161 commit 799637b

File tree

5 files changed

+200
-200
lines changed

5 files changed

+200
-200
lines changed

workspaces/backend/api/workspacekinds_handler.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type WorkspaceKindEnvelope Envelope[models.WorkspaceKind]
3939
//
4040
// @Summary Get workspace kind
4141
// @Description Returns details of a specific workspace kind identified by its name. Workspace kinds define the available types of workspaces that can be created.
42-
// @Tags workspace-kinds
42+
// @Tags workspacekinds
4343
// @Accept json
4444
// @Produce json
4545
// @Param name path string true "Name of the workspace kind" example(jupyterlab)
@@ -49,7 +49,7 @@ type WorkspaceKindEnvelope Envelope[models.WorkspaceKind]
4949
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to access the workspace kind."
5050
// @Failure 404 {object} ErrorEnvelope "Not Found. Workspace kind does not exist."
5151
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
52-
// @Router /api/v1/workspace-kinds/{name} [get]
52+
// @Router /workspacekinds/{name} [get]
5353
// @Security ApiKeyAuth
5454
func (a *App) GetWorkspaceKindHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
5555
name := ps.ByName(ResourceNamePathParam)
@@ -94,14 +94,14 @@ func (a *App) GetWorkspaceKindHandler(w http.ResponseWriter, r *http.Request, ps
9494
//
9595
// @Summary List workspace kinds
9696
// @Description Returns a list of all available workspace kinds. Workspace kinds define the different types of workspaces that can be created in the system.
97-
// @Tags workspace-kinds
97+
// @Tags workspacekinds
9898
// @Accept json
9999
// @Produce json
100100
// @Success 200 {object} WorkspaceKindListEnvelope "Successful operation. Returns a list of all available workspace kinds."
101101
// @Failure 401 {object} ErrorEnvelope "Unauthorized. Authentication is required."
102102
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to list workspace kinds."
103103
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
104-
// @Router /api/v1/workspace-kinds [get]
104+
// @Router /workspacekinds [get]
105105
// @Security ApiKeyAuth
106106
func (a *App) GetWorkspaceKindsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
107107
// =========================== AUTH ===========================

workspaces/backend/api/workspaces_handler.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type WorkspaceEnvelope Envelope[models.Workspace]
5454
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to access the workspace."
5555
// @Failure 404 {object} ErrorEnvelope "Not Found. Workspace does not exist."
5656
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
57-
// @Router /api/v1/workspaces/{namespace}/{workspace_name} [get]
57+
// @Router /workspaces/{namespace}/{workspace_name} [get]
5858
// @Security ApiKeyAuth
5959
func (a *App) GetWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
6060
namespace := ps.ByName(NamespacePathParam)
@@ -115,8 +115,8 @@ func (a *App) GetWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps htt
115115
// @Failure 401 {object} ErrorEnvelope "Unauthorized. Authentication is required."
116116
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to list workspaces."
117117
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
118-
// @Router /api/v1/workspaces [get]
119-
// @Router /api/v1/workspaces/{namespace} [get]
118+
// @Router /workspaces [get]
119+
// @Router /workspaces/{namespace} [get]
120120
// @Security ApiKeyAuth
121121
func (a *App) GetWorkspacesHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
122122
namespace := ps.ByName(NamespacePathParam)
@@ -179,7 +179,7 @@ func (a *App) GetWorkspacesHandler(w http.ResponseWriter, r *http.Request, ps ht
179179
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to create workspace."
180180
// @Failure 409 {object} ErrorEnvelope "Conflict. Workspace with the same name already exists."
181181
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
182-
// @Router /api/v1/workspaces/{namespace} [post]
182+
// @Router /workspaces/{namespace} [post]
183183
// @Security ApiKeyAuth
184184
func (a *App) CreateWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
185185
namespace := ps.ByName(NamespacePathParam)
@@ -274,7 +274,7 @@ func (a *App) CreateWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps
274274
// @Failure 403 {object} ErrorEnvelope "Forbidden. User does not have permission to delete the workspace."
275275
// @Failure 404 {object} ErrorEnvelope "Not Found. Workspace does not exist."
276276
// @Failure 500 {object} ErrorEnvelope "Internal server error. An unexpected error occurred on the server."
277-
// @Router /api/v1/workspaces/{namespace}/{workspace_name} [delete]
277+
// @Router /workspaces/{namespace}/{workspace_name} [delete]
278278
// @Security ApiKeyAuth
279279
func (a *App) DeleteWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
280280
namespace := ps.ByName(NamespacePathParam)

workspaces/backend/openapi/docs.go

+71-71
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,71 @@ const docTemplate = `{
1919
"host": "{{.Host}}",
2020
"basePath": "{{.BasePath}}",
2121
"paths": {
22-
"/api/v1/workspace-kinds": {
22+
"/healthcheck": {
23+
"get": {
24+
"description": "Provides a healthcheck response indicating the status of key services.",
25+
"produces": [
26+
"application/json"
27+
],
28+
"tags": [
29+
"healthcheck"
30+
],
31+
"summary": "Returns the health status of the application",
32+
"responses": {
33+
"200": {
34+
"description": "Successful healthcheck response",
35+
"schema": {
36+
"$ref": "#/definitions/health_check.HealthCheck"
37+
}
38+
},
39+
"500": {
40+
"description": "Internal server error",
41+
"schema": {
42+
"$ref": "#/definitions/api.ErrorEnvelope"
43+
}
44+
}
45+
}
46+
}
47+
},
48+
"/namespaces": {
49+
"get": {
50+
"description": "Provides a list of all namespaces that the user has access to",
51+
"produces": [
52+
"application/json"
53+
],
54+
"tags": [
55+
"namespaces"
56+
],
57+
"summary": "Returns a list of all namespaces",
58+
"responses": {
59+
"200": {
60+
"description": "Successful namespaces response",
61+
"schema": {
62+
"$ref": "#/definitions/api.NamespaceListEnvelope"
63+
}
64+
},
65+
"401": {
66+
"description": "Unauthorized",
67+
"schema": {
68+
"$ref": "#/definitions/api.ErrorEnvelope"
69+
}
70+
},
71+
"403": {
72+
"description": "Forbidden",
73+
"schema": {
74+
"$ref": "#/definitions/api.ErrorEnvelope"
75+
}
76+
},
77+
"500": {
78+
"description": "Internal server error",
79+
"schema": {
80+
"$ref": "#/definitions/api.ErrorEnvelope"
81+
}
82+
}
83+
}
84+
}
85+
},
86+
"/workspacekinds": {
2387
"get": {
2488
"security": [
2589
{
@@ -34,7 +98,7 @@ const docTemplate = `{
3498
"application/json"
3599
],
36100
"tags": [
37-
"workspace-kinds"
101+
"workspacekinds"
38102
],
39103
"summary": "List workspace kinds",
40104
"responses": {
@@ -65,7 +129,7 @@ const docTemplate = `{
65129
}
66130
}
67131
},
68-
"/api/v1/workspace-kinds/{name}": {
132+
"/workspacekinds/{name}": {
69133
"get": {
70134
"security": [
71135
{
@@ -80,7 +144,7 @@ const docTemplate = `{
80144
"application/json"
81145
],
82146
"tags": [
83-
"workspace-kinds"
147+
"workspacekinds"
84148
],
85149
"summary": "Get workspace kind",
86150
"parameters": [
@@ -133,7 +197,7 @@ const docTemplate = `{
133197
}
134198
}
135199
},
136-
"/api/v1/workspaces": {
200+
"/workspaces": {
137201
"get": {
138202
"security": [
139203
{
@@ -185,7 +249,7 @@ const docTemplate = `{
185249
}
186250
}
187251
},
188-
"/api/v1/workspaces/{namespace}": {
252+
"/workspaces/{namespace}": {
189253
"get": {
190254
"security": [
191255
{
@@ -321,7 +385,7 @@ const docTemplate = `{
321385
}
322386
}
323387
},
324-
"/api/v1/workspaces/{namespace}/{workspace_name}": {
388+
"/workspaces/{namespace}/{workspace_name}": {
325389
"get": {
326390
"security": [
327391
{
@@ -467,70 +531,6 @@ const docTemplate = `{
467531
}
468532
}
469533
}
470-
},
471-
"/healthcheck": {
472-
"get": {
473-
"description": "Provides a healthcheck response indicating the status of key services.",
474-
"produces": [
475-
"application/json"
476-
],
477-
"tags": [
478-
"healthcheck"
479-
],
480-
"summary": "Returns the health status of the application",
481-
"responses": {
482-
"200": {
483-
"description": "Successful healthcheck response",
484-
"schema": {
485-
"$ref": "#/definitions/health_check.HealthCheck"
486-
}
487-
},
488-
"500": {
489-
"description": "Internal server error",
490-
"schema": {
491-
"$ref": "#/definitions/api.ErrorEnvelope"
492-
}
493-
}
494-
}
495-
}
496-
},
497-
"/namespaces": {
498-
"get": {
499-
"description": "Provides a list of all namespaces that the user has access to",
500-
"produces": [
501-
"application/json"
502-
],
503-
"tags": [
504-
"namespaces"
505-
],
506-
"summary": "Returns a list of all namespaces",
507-
"responses": {
508-
"200": {
509-
"description": "Successful namespaces response",
510-
"schema": {
511-
"$ref": "#/definitions/api.NamespaceListEnvelope"
512-
}
513-
},
514-
"401": {
515-
"description": "Unauthorized",
516-
"schema": {
517-
"$ref": "#/definitions/api.ErrorEnvelope"
518-
}
519-
},
520-
"403": {
521-
"description": "Forbidden",
522-
"schema": {
523-
"$ref": "#/definitions/api.ErrorEnvelope"
524-
}
525-
},
526-
"500": {
527-
"description": "Internal server error",
528-
"schema": {
529-
"$ref": "#/definitions/api.ErrorEnvelope"
530-
}
531-
}
532-
}
533-
}
534534
}
535535
},
536536
"definitions": {

0 commit comments

Comments
 (0)