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

[Tag] Update swagger doc #216

Merged
merged 1 commit into from
Dec 19, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/handler/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (t *TagsHandler) CreateTag(ctx *gin.Context) {
// @Success 200 {object} types.Response{database.Tag} "OK"
// @Failure 400 {object} types.APIBadRequest "Bad request"
// @Failure 500 {object} types.APIInternalServerError "Internal server error"
// @Router /tag/{id} [get]
// @Router /tags/{id} [get]
func (t *TagsHandler) GetTagByID(ctx *gin.Context) {
userName := httpbase.GetCurrentUser(ctx)
if userName == "" {
Expand Down Expand Up @@ -133,7 +133,7 @@ func (t *TagsHandler) GetTagByID(ctx *gin.Context) {
// @Success 200 {object} types.Response{database.Tag} "OK"
// @Failure 400 {object} types.APIBadRequest "Bad request"
// @Failure 500 {object} types.APIInternalServerError "Internal server error"
// @Router /tag/{id} [put]
// @Router /tags/{id} [put]
func (t *TagsHandler) UpdateTag(ctx *gin.Context) {
userName := httpbase.GetCurrentUser(ctx)
if userName == "" {
Expand Down Expand Up @@ -172,7 +172,7 @@ func (t *TagsHandler) UpdateTag(ctx *gin.Context) {
// @Success 200 {object} types.Response{} "OK"
// @Failure 400 {object} types.APIBadRequest "Bad request"
// @Failure 500 {object} types.APIInternalServerError "Internal server error"
// @Router /tag/{id} [delete]
// @Router /tags/{id} [delete]
func (t *TagsHandler) DeleteTag(ctx *gin.Context) {
userName := httpbase.GetCurrentUser(ctx)
if userName == "" {
Expand Down
136 changes: 68 additions & 68 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10022,14 +10022,14 @@ const docTemplate = `{
}
}
},
"/tag/{id}": {
"/tags": {
SeanHH86 marked this conversation as resolved.
Show resolved Hide resolved
"get": {
"security": [
{
"ApiKey": []
}
],
"description": "Get a tag by id",
"description": "Get all tags",
"consumes": [
"application/json"
],
Expand All @@ -10039,21 +10039,45 @@ const docTemplate = `{
"tags": [
"Tag"
],
"summary": "Get a tag by id",
"summary": "Get all tags",
"parameters": [
{
"type": "string",
"description": "id of the tag",
"name": "id",
"in": "path",
"required": true
"description": "category name",
"name": "category",
"in": "query"
},
{
"enum": [
"model",
"dataset"
],
"type": "string",
"description": "scope name",
"name": "scope",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"description": "tags",
"schema": {
"$ref": "#/definitions/types.Response"
"allOf": [
{
"$ref": "#/definitions/types.ResponseWithTotal"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/database.Tag"
}
}
}
}
]
}
},
"400": {
Expand All @@ -10070,13 +10094,13 @@ const docTemplate = `{
}
}
},
"put": {
"post": {
SeanHH86 marked this conversation as resolved.
Show resolved Hide resolved
"security": [
{
"ApiKey": []
}
],
"description": "Update a tag by id",
"description": "Create new tag",
"consumes": [
"application/json"
],
Expand All @@ -10086,22 +10110,15 @@ const docTemplate = `{
"tags": [
"Tag"
],
"summary": "Update a tag by id",
"summary": "Create new tag",
"parameters": [
{
"type": "string",
"description": "id of the tag",
"name": "id",
"in": "path",
"required": true
},
{
"description": "body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.UpdateTag"
"$ref": "#/definitions/types.CreateTag"
}
}
],
Expand All @@ -10125,14 +10142,16 @@ const docTemplate = `{
}
}
}
},
"delete": {
}
},
"/tags/{id}": {
"get": {
"security": [
{
"ApiKey": []
}
],
"description": "Delete a tag by id",
"description": "Get a tag by id",
"consumes": [
"application/json"
],
Expand All @@ -10142,7 +10161,7 @@ const docTemplate = `{
"tags": [
"Tag"
],
"summary": "Delete a tag by id",
"summary": "Get a tag by id",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -10172,16 +10191,14 @@ const docTemplate = `{
}
}
}
}
},
"/tags": {
"get": {
},
"put": {
"security": [
{
"ApiKey": []
}
],
"description": "Get all tags",
"description": "Update a tag by id",
"consumes": [
"application/json"
],
Expand All @@ -10191,45 +10208,30 @@ const docTemplate = `{
"tags": [
"Tag"
],
"summary": "Get all tags",
"summary": "Update a tag by id",
"parameters": [
{
"type": "string",
"description": "category name",
"name": "category",
"in": "query"
"description": "id of the tag",
"name": "id",
"in": "path",
"required": true
},
{
"enum": [
"model",
"dataset"
],
"type": "string",
"description": "scope name",
"name": "scope",
"in": "query"
"description": "body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.UpdateTag"
}
}
],
"responses": {
"200": {
"description": "tags",
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/types.ResponseWithTotal"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/database.Tag"
}
}
}
}
]
"$ref": "#/definitions/types.Response"
}
},
"400": {
Expand All @@ -10246,13 +10248,13 @@ const docTemplate = `{
}
}
},
"post": {
"delete": {
"security": [
{
"ApiKey": []
}
],
"description": "Create new tag",
"description": "Delete a tag by id",
"consumes": [
"application/json"
],
Expand All @@ -10262,16 +10264,14 @@ const docTemplate = `{
"tags": [
"Tag"
],
"summary": "Create new tag",
"summary": "Delete a tag by id",
"parameters": [
{
"description": "body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.CreateTag"
}
"type": "string",
"description": "id of the tag",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
Expand Down
Loading
Loading