class ExperimentRestApi {

  @PATCH
  @Path("/{id}")
  @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON})
  @Operation(summary = "Update the experiment in the submarine server with spec",
      tags = {"experiment"},
      responses = {
          @ApiResponse(description = "successful operation", content = @Content(
              schema = @Schema(implementation = JsonResponse.class))),
          @ApiResponse(responseCode = "404", description = "Experiment not found")})
  public Response patchExperiment(@PathParam(RestConstants.ID) String id, ExperimentSpec spec) {
    try {
      Experiment experiment = experimentManager.patchExperiment(id, spec);
      return new JsonResponse.Builder<Experiment>(Response.Status.OK).success(true)
          .result(experiment).build();
    } catch (SubmarineRuntimeException e) {
      return parseExperimentServiceException(e);
    }
  }

}