Skip to content

Commit

Permalink
fix(v2PipelineTemplates): set response code to 200 OK because of swag…
Browse files Browse the repository at this point in the history
…ger (#1307)

Swagger on 2.14.5 codegen for Go doesn't parse the body for a caller. The workaround for now is to return a 200 so swagger will return the body back to a calling method. This is documented in swagger-api/swagger-codegen#10435
  • Loading branch information
kevinawoo committed Aug 18, 2020
1 parent 99146d7 commit e8e9b8c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Map<String, Object> plan(@RequestBody Map<String, Object> pipeline) {

@ApiOperation(value = "(ALPHA) Create a pipeline template.", response = HashMap.class)
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.ACCEPTED)
@ResponseStatus(value = HttpStatus.OK)
public Map create(
@RequestParam(value = "tag", required = false) String tag,
@RequestBody Map<String, Object> pipelineTemplate) {
Expand Down Expand Up @@ -135,7 +135,7 @@ private void validateSchema(Map<String, Object> pipelineTemplate) {

@ApiOperation(value = "(ALPHA) Update a pipeline template.", response = HashMap.class)
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.ACCEPTED)
@ResponseStatus(value = HttpStatus.OK)
public Map update(
@PathVariable String id,
@RequestParam(value = "tag", required = false) String tag,
Expand Down Expand Up @@ -186,7 +186,7 @@ public Map get(

@ApiOperation(value = "Delete a pipeline template.", response = HashMap.class)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(value = HttpStatus.ACCEPTED)
@ResponseStatus(value = HttpStatus.OK)
public Map delete(
@PathVariable String id,
@RequestParam(value = "tag", required = false) String tag,
Expand Down

0 comments on commit e8e9b8c

Please sign in to comment.