mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +08:00
fix: [CODE-2478]: fix swagger of webhook execution (#2796)
This commit is contained in:
parent
966cd70c4a
commit
f4659a0c31
@ -199,12 +199,13 @@ func webhookOperations(reflector *openapi3.Reflector) {
|
|||||||
retriggerWebhookExecution := openapi3.Operation{}
|
retriggerWebhookExecution := openapi3.Operation{}
|
||||||
retriggerWebhookExecution.WithTags("webhook")
|
retriggerWebhookExecution.WithTags("webhook")
|
||||||
retriggerWebhookExecution.WithMapOfAnything(map[string]interface{}{"operationId": "retriggerWebhookExecution"})
|
retriggerWebhookExecution.WithMapOfAnything(map[string]interface{}{"operationId": "retriggerWebhookExecution"})
|
||||||
_ = reflector.SetRequest(&retriggerWebhookExecution, nil, http.MethodPost)
|
_ = reflector.SetRequest(&retriggerWebhookExecution, new(webhookExecutionRequest), http.MethodPost)
|
||||||
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(types.WebhookExecution), http.StatusOK)
|
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(types.WebhookExecution), http.StatusOK)
|
||||||
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusBadRequest)
|
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusBadRequest)
|
||||||
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusInternalServerError)
|
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusInternalServerError)
|
||||||
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusUnauthorized)
|
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusUnauthorized)
|
||||||
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusForbidden)
|
_ = reflector.SetJSONResponse(&retriggerWebhookExecution, new(usererror.Error), http.StatusForbidden)
|
||||||
_ = reflector.Spec.AddOperation(http.MethodGet,
|
_ = reflector.Spec.AddOperation(http.MethodPost,
|
||||||
"/repos/{repo_ref}/webhooks/{webhook_identifier}/executions/{webhook_execution_id}", retriggerWebhookExecution)
|
"/repos/{repo_ref}/webhooks/{webhook_identifier}/executions/{webhook_execution_id}/retrigger",
|
||||||
|
retriggerWebhookExecution)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user