mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +08:00
swagger ref added for rawdiff
This commit is contained in:
parent
58a2d90973
commit
72485456ab
@ -120,6 +120,11 @@ type listTagsRequest struct {
|
||||
repoRequest
|
||||
}
|
||||
|
||||
type getRawDiffRequest struct {
|
||||
repoRequest
|
||||
Range string `path:"range" example:"main..dev"`
|
||||
}
|
||||
|
||||
var queryParameterGitRef = openapi3.ParameterOrRef{
|
||||
Parameter: &openapi3.Parameter{
|
||||
Name: request.QueryParamGitRef,
|
||||
@ -434,4 +439,14 @@ func repoOperations(reflector *openapi3.Reflector) {
|
||||
_ = reflector.SetJSONResponse(&opCommitFiles, new(usererror.Error), http.StatusForbidden)
|
||||
_ = reflector.SetJSONResponse(&opCommitFiles, new(usererror.Error), http.StatusNotFound)
|
||||
_ = reflector.Spec.AddOperation(http.MethodPost, "/repos/{repo_ref}/commits", opCommitFiles)
|
||||
|
||||
opRawDiff := openapi3.Operation{}
|
||||
opRawDiff.WithTags("repository")
|
||||
opRawDiff.WithMapOfAnything(map[string]interface{}{"operationId": "rawDiff"})
|
||||
_ = reflector.SetRequest(&opRawDiff, new(getRawDiffRequest), http.MethodGet)
|
||||
_ = reflector.SetStringResponse(&opRawDiff, http.StatusOK, "text/plain")
|
||||
_ = reflector.SetJSONResponse(&opRawDiff, new(usererror.Error), http.StatusInternalServerError)
|
||||
_ = reflector.SetJSONResponse(&opRawDiff, new(usererror.Error), http.StatusUnauthorized)
|
||||
_ = reflector.SetJSONResponse(&opRawDiff, new(usererror.Error), http.StatusForbidden)
|
||||
_ = reflector.Spec.AddOperation(http.MethodGet, "/repos/{repo_ref}/compare/{range}", opRawDiff)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user