X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Fcontrollers%2Fproducer%2FProducerController.java;h=7e905dab5973c79f2d2db5e55ac59c45223513a3;hb=30f931f999a839a549d6c3bda6e182c8e3ec0b2f;hp=349e5d560df7113aae08fa3d6b39123a0750a06f;hpb=10e254d9b7bc522bb2c25d590e6d203bf25a592d;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerController.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerController.java index 349e5d56..7e905dab 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerController.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerController.java @@ -112,11 +112,20 @@ public class ProducerController { } @PutMapping(path = ProducerConsts.API_ROOT + "/eitypes/{eiTypeId}", produces = MediaType.APPLICATION_JSON_VALUE) + @ApiResponses( + value = { // + @ApiResponse(code = 200, message = "Type updated", response = VoidResponse.class), // + @ApiResponse(code = 201, message = "Type created", response = VoidResponse.class), // + @ApiResponse(code = 400, message = "Bad request", response = ErrorResponse.ErrorInfo.class)}) + @ApiOperation(value = "Individual EI type", notes = "") public ResponseEntity putEiType( // @PathVariable("eiTypeId") String eiTypeId, @RequestBody ProducerEiTypeInfo registrationInfo) { EiType previousDefinition = this.eiTypes.get(eiTypeId); + if (registrationInfo.jobDataSchema == null) { + return ErrorResponse.create("No schema provided", HttpStatus.BAD_REQUEST); + } this.eiTypes.put(new EiType(eiTypeId, registrationInfo.jobDataSchema)); return new ResponseEntity<>(previousDefinition == null ? HttpStatus.CREATED : HttpStatus.OK); } @@ -182,7 +191,7 @@ public class ProducerController { @ApiOperation(value = "Individual EI producer", notes = "") @ApiResponses( value = { // - @ApiResponse(code = 200, message = "EI jobs", response = ProducerRegistrationInfo.class), // + @ApiResponse(code = 200, message = "EI producer", response = ProducerRegistrationInfo.class), // @ApiResponse( code = 404, message = "Enrichment Information producer is not found", @@ -204,7 +213,11 @@ public class ProducerController { @ApiOperation(value = "EI job definitions", notes = "EI job definitions for one EI producer") @ApiResponses( value = { // - @ApiResponse(code = 200, message = "EI jobs", response = ProducerJobInfo.class, responseContainer = "List"), // + @ApiResponse( + code = 200, + message = "EI producer", + response = ProducerJobInfo.class, + responseContainer = "List"), // @ApiResponse( code = 404, message = "Enrichment Information producer is not found", @@ -233,7 +246,7 @@ public class ProducerController { @ApiOperation(value = "EI producer status") @ApiResponses( value = { // - @ApiResponse(code = 200, message = "EI jobs", response = ProducerStatusInfo.class), // + @ApiResponse(code = 200, message = "EI producer status", response = ProducerStatusInfo.class), // @ApiResponse( code = 404, message = "Enrichment Information producer is not found", @@ -256,13 +269,13 @@ public class ProducerController { } @PutMapping( - path = ProducerConsts.API_ROOT + "/eiproducers/{eiProducerId}", + path = ProducerConsts.API_ROOT + "/eiproducers/{eiProducerId}", // produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Individual EI producer", notes = "") @ApiResponses( value = { // @ApiResponse(code = 201, message = "Producer created", response = VoidResponse.class), // - @ApiResponse(code = 200, message = "Producer updated", response = VoidResponse.class)}// + @ApiResponse(code = 200, message = "Producer updated", response = VoidResponse.class)} // ) public ResponseEntity putEiProducer( // @PathVariable("eiProducerId") String eiProducerId, //