Skip to content

Commit

Permalink
fix swagger spec
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Mar 13, 2024
1 parent 70c5e1b commit 2a87d2e
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 240 deletions.
275 changes: 131 additions & 144 deletions api/v1/controllers/batches/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,35 +78,33 @@ func (controller *batchController) GetRoutes() []api.Route {
// ---
// summary: Create batch
// parameters:
// - name: batchCreation
// in: body
// description: Batch to create
// required: true
// schema:
// "$ref": "#/definitions/BatchScheduleDescription"
//
// - name: batchCreation
// in: body
// description: Batch to create
// required: true
// schema:
// "$ref": "#/definitions/BatchScheduleDescription"
// responses:
//
// "200":
// description: "Successful create batch"
// schema:
// "$ref": "#/definitions/BatchStatus"
// "400":
// description: "Bad request"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "422":
// description: "Invalid data in request"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful create batch"
// schema:
// "$ref": "#/definitions/BatchStatus"
// "400":
// description: "Bad request"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "422":
// description: "Invalid data in request"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) CreateBatch(c *gin.Context) {
logger := log.Ctx(c.Request.Context())
logger.Info().Msg("Create Batch")
Expand Down Expand Up @@ -141,17 +139,16 @@ func (controller *batchController) CreateBatch(c *gin.Context) {
// summary: Gets batches
// parameters:
// responses:
//
// "200":
// description: "Successful get batches"
// schema:
// type: "array"
// items:
// "$ref": "#/definitions/BatchStatus"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful get batches"
// schema:
// type: "array"
// items:
// "$ref": "#/definitions/BatchStatus"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) GetBatches(c *gin.Context) {
logger := log.Ctx(c.Request.Context())
logger.Info().Msg("Get batch list")
Expand All @@ -168,26 +165,24 @@ func (controller *batchController) GetBatches(c *gin.Context) {
// ---
// summary: Gets batch
// parameters:
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
//
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// responses:
//
// "200":
// description: "Successful get batch"
// schema:
// "$ref": "#/definitions/BatchStatus"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful get batch"
// schema:
// "$ref": "#/definitions/BatchStatus"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) GetBatch(c *gin.Context) {
batchName := c.Param(batchNameParam)
logger := log.Ctx(c.Request.Context())
Expand All @@ -204,31 +199,29 @@ func (controller *batchController) GetBatch(c *gin.Context) {
// ---
// summary: Gets batch job
// parameters:
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// - name: jobName
// in: path
// description: Name of job
// type: string
// required: true
//
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// - name: jobName
// in: path
// description: Name of job
// type: string
// required: true
// responses:
//
// "200":
// description: "Successful get job"
// schema:
// "$ref": "#/definitions/JobStatus"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful get job"
// schema:
// "$ref": "#/definitions/JobStatus"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) GetBatchJob(c *gin.Context) {
batchName := c.Param(batchNameParam)
jobName := c.Param(jobNameParam)
Expand All @@ -246,26 +239,24 @@ func (controller *batchController) GetBatchJob(c *gin.Context) {
// ---
// summary: Delete batch
// parameters:
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
//
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// responses:
//
// "200":
// description: "Successful delete batch"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful delete batch"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) DeleteBatch(c *gin.Context) {
batchName := c.Param(batchNameParam)
logger := log.Ctx(c.Request.Context())
Expand All @@ -289,26 +280,24 @@ func (controller *batchController) DeleteBatch(c *gin.Context) {
// ---
// summary: Stop batch
// parameters:
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
//
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// responses:
//
// "200":
// description: "Successful stop batch"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful stop batch"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) StopBatch(c *gin.Context) {
batchName := c.Param(batchNameParam)
logger := log.Ctx(c.Request.Context())
Expand All @@ -332,31 +321,29 @@ func (controller *batchController) StopBatch(c *gin.Context) {
// ---
// summary: Stop batch job
// parameters:
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// - name: jobName
// in: path
// description: Name of job
// type: string
// required: true
//
// - name: batchName
// in: path
// description: Name of batch
// type: string
// required: true
// - name: jobName
// in: path
// description: Name of job
// type: string
// required: true
// responses:
//
// "200":
// description: "Successful stop batch job"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
// "200":
// description: "Successful stop batch job"
// schema:
// "$ref": "#/definitions/Status"
// "404":
// description: "Not found"
// schema:
// "$ref": "#/definitions/Status"
// "500":
// description: "Internal server error"
// schema:
// "$ref": "#/definitions/Status"
func (controller *batchController) StopBatchJob(c *gin.Context) {
batchName := c.Param(batchNameParam)
jobName := c.Param(jobNameParam)
Expand Down
Loading

0 comments on commit 2a87d2e

Please sign in to comment.