mirror of
https://github.com/harness/drone.git
synced 2025-05-17 09:30:00 +08:00
swagger ref added for rawdiff
This commit is contained in:
parent
58a2d90973
commit
72485456ab
@ -120,6 +120,11 @@ type listTagsRequest struct {
|
|||||||
repoRequest
|
repoRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type getRawDiffRequest struct {
|
||||||
|
repoRequest
|
||||||
|
Range string `path:"range" example:"main..dev"`
|
||||||
|
}
|
||||||
|
|
||||||
var queryParameterGitRef = openapi3.ParameterOrRef{
|
var queryParameterGitRef = openapi3.ParameterOrRef{
|
||||||
Parameter: &openapi3.Parameter{
|
Parameter: &openapi3.Parameter{
|
||||||
Name: request.QueryParamGitRef,
|
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.StatusForbidden)
|
||||||
_ = reflector.SetJSONResponse(&opCommitFiles, new(usererror.Error), http.StatusNotFound)
|
_ = reflector.SetJSONResponse(&opCommitFiles, new(usererror.Error), http.StatusNotFound)
|
||||||
_ = reflector.Spec.AddOperation(http.MethodPost, "/repos/{repo_ref}/commits", opCommitFiles)
|
_ = 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