Skip to content

Commit

Permalink
Update swagger documentation (go-gitea#2899)
Browse files Browse the repository at this point in the history
* Update swagger documentation

Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation

* Restore delete comments
  • Loading branch information
ethantkoenig authored and lafriks committed Nov 13, 2017
1 parent 4287d10 commit f26f4a7
Show file tree
Hide file tree
Showing 72 changed files with 9,061 additions and 2,509 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ generate-swagger:
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
fi
swagger generate spec -o ./public/swagger.v1.json
$(SED_INPLACE) "s;\".ref\": \"#/definitions/GPGKey\";\"type\": \"object\";g" ./public/swagger.v1.json
$(SED_INPLACE) "s;^ \".ref\": \"#/definitions/Repository\"; \"type\": \"object\";g" ./public/swagger.v1.json

.PHONY: errcheck
errcheck:
Expand Down
13 changes: 8 additions & 5 deletions modules/auth/repo_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) bin

// MigrateRepoForm form for migrating repository
type MigrateRepoForm struct {
// required: true
CloneAddr string `json:"clone_addr" binding:"Required"`
AuthUsername string `json:"auth_username"`
AuthPassword string `json:"auth_password"`
UID int64 `json:"uid" binding:"Required"`
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
Mirror bool `json:"mirror"`
Private bool `json:"private"`
Description string `json:"description" binding:"MaxSize(255)"`
// required: true
UID int64 `json:"uid" binding:"Required"`
// required: true
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
Mirror bool `json:"mirror"`
Private bool `json:"private"`
Description string `json:"description" binding:"MaxSize(255)"`
}

// Validate validates the fields
Expand Down
Loading

0 comments on commit f26f4a7

Please sign in to comment.