Skip to content

Commit cfa79a0

Browse files
committed
api: make updating name optional in repo edit
and path escape the new name param
1 parent 1b177bb commit cfa79a0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

api/repos.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func apiReposCreate(c *gin.Context) {
196196

197197
type reposEditParams struct {
198198
// Name of repository to modify
199-
Name *string `binding:"required" json:"Name" example:"repo1"`
199+
Name *string ` json:"Name" example:"new-repo-name"`
200200
// Change Comment of repository
201201
Comment *string ` json:"Comment" example:"example repo"`
202202
// Change Default Distribution for publishing
@@ -208,7 +208,7 @@ type reposEditParams struct {
208208
// @Summary Update Repository
209209
// @Description **Update local repository meta information**
210210
// @Tags Repos
211-
// @Param name path string true "Repository name"
211+
// @Param name path string true "Repository name to modify"
212212
// @Consume json
213213
// @Param request body reposEditParams true "Parameters"
214214
// @Produce json
@@ -221,7 +221,6 @@ func apiReposEdit(c *gin.Context) {
221221
if c.Bind(&b) != nil {
222222
return
223223
}
224-
225224
// Load shallowly for 404 check and resource key.
226225
// Mutation and duplicate check happen inside the task for atomicity.
227226
collectionFactory := context.NewCollectionFactory()

0 commit comments

Comments
 (0)