From: PatrikBuhr Date: Tue, 19 Jan 2021 10:59:06 +0000 (+0100) Subject: Minor documentation improvements X-Git-Tag: 2.2.0~81^2~1 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=6296305fad90e21103fa92e05e0d21a3ba1356a2;p=nonrtric.git Minor documentation improvements Change-Id: I83821c1655ff15d76bced243581dd323b01d6e45 Signed-off-by: PatrikBuhr Issue-ID: NONRTRIC-378 --- diff --git a/enrichment-coordinator-service/api/ecs-api.json b/enrichment-coordinator-service/api/ecs-api.json index d55dc184..37416ac8 100644 --- a/enrichment-coordinator-service/api/ecs-api.json +++ b/enrichment-coordinator-service/api/ecs-api.json @@ -126,7 +126,7 @@ "responses": { "200": { "schema": {"$ref": "#/definitions/producer_status"}, - "description": "EI jobs" + "description": "EI producer status" }, "401": {"description": "Unauthorized"}, "403": {"description": "Forbidden"}, @@ -252,8 +252,8 @@ "produces": ["application/json"], "operationId": "putEiTypeUsingPUT", "responses": { - "200": {"description": "OK"}, - "201": {"description": "Created"}, + "200": {"description": "Type updated"}, + "201": {"description": "Type created"}, "400": { "schema": {"$ref": "#/definitions/ProblemDetails"}, "description": "Bad request" @@ -393,7 +393,7 @@ "responses": { "200": { "schema": {"$ref": "#/definitions/producer_registration_info"}, - "description": "EI jobs" + "description": "EI producer" }, "401": {"description": "Unauthorized"}, "403": {"description": "Forbidden"}, @@ -495,7 +495,7 @@ "type": "array", "items": {"$ref": "#/definitions/producer_ei_job_request"} }, - "description": "EI jobs" + "description": "EI producer" }, "401": {"description": "Unauthorized"}, "403": {"description": "Forbidden"}, @@ -644,10 +644,6 @@ } } }, - "Mono«ResponseEntity«object»»": { - "type": "object", - "title": "Mono«ResponseEntity«object»»" - }, "producer_ei_type_info": { "description": "Information for an EI type", "type": "object", @@ -715,11 +711,6 @@ } } }, - "Void": { - "description": "Void/empty", - "type": "object", - "title": "Void" - }, "EiJobStatusObject": { "description": "Status for an EI job", "type": "object", diff --git a/enrichment-coordinator-service/api/ecs-api.yaml b/enrichment-coordinator-service/api/ecs-api.yaml index d7d5eb3a..d1aa1873 100644 --- a/enrichment-coordinator-service/api/ecs-api.yaml +++ b/enrichment-coordinator-service/api/ecs-api.yaml @@ -182,7 +182,7 @@ paths: type: string responses: 200: - description: EI jobs + description: EI producer status content: application/json: schema: @@ -313,10 +313,10 @@ paths: required: true responses: 200: - description: OK + description: Type updated content: {} 201: - description: Created + description: Type created content: {} 400: description: Bad request @@ -514,7 +514,7 @@ paths: type: string responses: 200: - description: EI jobs + description: EI producer content: application/json: schema: @@ -639,7 +639,7 @@ paths: type: string responses: 200: - description: EI jobs + description: EI producer content: application/json: schema: @@ -785,9 +785,6 @@ components: status: type: string description: status text - Mono«ResponseEntity«object»»: - title: Mono«ResponseEntity«object»» - type: object producer_ei_type_info: title: producer_ei_type_info required: @@ -852,10 +849,6 @@ components: example: 404 description: A problem detail to carry details in a HTTP response according to RFC 7807 - Void: - title: Void - type: object - description: Void/empty EiJobStatusObject: title: EiJobStatusObject required: 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 4b7063cd..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 @@ -114,10 +114,10 @@ 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)}) + @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) { @@ -191,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", @@ -213,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", @@ -242,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", @@ -265,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, // diff --git a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java index b2ec0b14..a863c103 100644 --- a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java +++ b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java @@ -170,6 +170,8 @@ class ApplicationTest { JSONObject jsonObj = new JSONObject(resp.getBody()); jsonObj.remove("host"); + assertThat(jsonObj.getJSONObject("definitions").remove("Mono«ResponseEntity«object»»")).isNotNull(); + assertThat(jsonObj.getJSONObject("definitions").remove("Void")).isNotNull(); String indented = jsonObj.toString(4); try (PrintStream out = new PrintStream(new FileOutputStream("api/ecs-api.json"))) { out.print(indented);