Minor documentation improvements 65/5465/1
authorPatrikBuhr <patrik.buhr@est.tech>
Tue, 19 Jan 2021 10:59:06 +0000 (11:59 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Tue, 19 Jan 2021 10:59:33 +0000 (11:59 +0100)
Change-Id: I83821c1655ff15d76bced243581dd323b01d6e45
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-378

enrichment-coordinator-service/api/ecs-api.json
enrichment-coordinator-service/api/ecs-api.yaml
enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerController.java
enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java

index d55dc18..37416ac 100644 (file)
             "responses": {
                 "200": {
                     "schema": {"$ref": "#/definitions/producer_status"},
-                    "description": "EI jobs"
+                    "description": "EI producer status"
                 },
                 "401": {"description": "Unauthorized"},
                 "403": {"description": "Forbidden"},
                 "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"
                 "responses": {
                     "200": {
                         "schema": {"$ref": "#/definitions/producer_registration_info"},
-                        "description": "EI jobs"
+                        "description": "EI producer"
                     },
                     "401": {"description": "Unauthorized"},
                     "403": {"description": "Forbidden"},
                         "type": "array",
                         "items": {"$ref": "#/definitions/producer_ei_job_request"}
                     },
-                    "description": "EI jobs"
+                    "description": "EI producer"
                 },
                 "401": {"description": "Unauthorized"},
                 "403": {"description": "Forbidden"},
                 }
             }
         },
-        "Mono«ResponseEntity«object»»": {
-            "type": "object",
-            "title": "Mono«ResponseEntity«object»»"
-        },
         "producer_ei_type_info": {
             "description": "Information for an EI type",
             "type": "object",
                 }
             }
         },
-        "Void": {
-            "description": "Void/empty",
-            "type": "object",
-            "title": "Void"
-        },
         "EiJobStatusObject": {
             "description": "Status for an EI job",
             "type": "object",
index d7d5eb3..d1aa187 100644 (file)
@@ -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:
index 4b7063c..7e905da 100644 (file)
@@ -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<Object> 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<Object> putEiProducer( //
         @PathVariable("eiProducerId") String eiProducerId, //
index b2ec0b1..a863c10 100644 (file)
@@ -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);