Fix API data types, use unsecured router for /docs

- Note: Use /docs swagger playground without login
- Otherwise: Session User will be used which leads to role mismatch
This commit is contained in:
Christoph Kluge
2022-09-15 17:38:11 +02:00
parent 8e90c954ff
commit 922e94e835
5 changed files with 277 additions and 18 deletions

View File

@@ -327,7 +327,7 @@ func (api *RestApi) tagJob(rw http.ResponseWriter, r *http.Request) {
// @Tags jobs
// @Accept json
// @Produce json
// @Param request body schema.Job true "Job to add"
// @Param request body schema.JobMeta true "Job to add"
// @Success 201 {object} api.StartJobApiResponse "Job added successfully"
// @Failure 400 {object} api.ErrorResponse "Bad Request"
// @Failure 422 {object} api.ErrorResponse "The combination of jobId, clusterId and startTime does already exist"
@@ -507,7 +507,7 @@ func (api *RestApi) stopJobById(rw http.ResponseWriter, r *http.Request) {
// @Accept json
// @Produce json
// @Param request body api.StopJobApiRequest true "All fields required"
// @Success 201 {object} schema.Job "Job resource"
// @Success 201 {object} schema.JobMeta "Job resource"
// @Failure 400 {object} api.ErrorResponse "Bad Request"
// @Failure 404 {object} api.ErrorResponse "Resource not found"
// @Security ApiKeyAuth