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;fp=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Fcontrollers%2Fproducer%2FProducerController.java;h=4b7063cd98fb046a631c7d6deaf1b8a3ee5e1bac;hb=fed5fc967794cb3d9d9abf3d48283908eff36cc9;hp=349e5d560df7113aae08fa3d6b39123a0750a06f;hpb=32180137b6aca9c3a4519ac00cb573cbae9dca83;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..4b7063cd 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 = "OK", 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); }