Skip to content

Commit 947887e

Browse files
committed
[debian] api: make updating name optional in repo edit
and path escape the new name param
1 parent 1268c36 commit 947887e

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
@@ -187,7 +187,7 @@ func apiReposCreate(c *gin.Context) {
187187

188188
type reposEditParams struct {
189189
// Name of repository to modify
190-
Name *string `binding:"required" json:"Name" example:"repo1"`
190+
Name *string ` json:"Name" example:"new-repo-name"`
191191
// Change Comment of repository
192192
Comment *string ` json:"Comment" example:"example repo"`
193193
// Change Default Distribution for publishing
@@ -199,7 +199,7 @@ type reposEditParams struct {
199199
// @Summary Update Repository
200200
// @Description **Update local repository meta information**
201201
// @Tags Repos
202-
// @Param name path string true "Repository name"
202+
// @Param name path string true "Repository name to modify"
203203
// @Consume json
204204
// @Param request body reposEditParams true "Parameters"
205205
// @Produce json
@@ -212,7 +212,6 @@ func apiReposEdit(c *gin.Context) {
212212
if c.Bind(&b) != nil {
213213
return
214214
}
215-
216215
// Load shallowly for 404 check and resource key.
217216
// Mutation and duplicate check happen inside the task for atomicity.
218217
collectionFactory := context.NewCollectionFactory()

0 commit comments

Comments
 (0)