فهرست منبع

Change createNewSchema action's endpoint

Ildar Almakaev 4 سال پیش
والد
کامیت
af580e1fc4

+ 1 - 1
kafka-ui-api/src/main/java/com/provectus/kafka/ui/cluster/service/SchemaRegistryService.java

@@ -109,7 +109,7 @@ public class SchemaRegistryService {
                         .retrieve()
                         .onStatus(HttpStatus::isError, ClientResponse::createException)
                         .toEntity(SchemaSubject.class)
-                        .doOnError(log::error))
+                        .log())
                 .orElse(Mono.error(new NotFoundException("No such cluster")));
     }
 

+ 29 - 29
kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml

@@ -358,11 +358,11 @@ paths:
                   type: string
 
   /api/clusters/{clusterName}/schemas/{schemaName}:
-    delete:
+    post:
       tags:
         - /api/clusters
-      summary: delete schema from Schema Registry service
-      operationId: deleteSchema
+      summary: create a new subject schema
+      operationId: createNewSchema
       parameters:
         - name: clusterName
           in: path
@@ -374,18 +374,25 @@ paths:
           required: true
           schema:
             type: string
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/NewSchemaSubject'
       responses:
         200:
-          description: OK
-        404:
-          description: Not found
-
-  /api/clusters/{clusterName}/schemas/{schemaName}/versions:
-    get:
+          description: Updated
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/SchemaSubject'
+        400:
+          description: Bad request
+    delete:
       tags:
         - /api/clusters
-      summary: get all version of schema from Schema Registry service
-      operationId: getSchemaVersions
+      summary: delete schema from Schema Registry service
+      operationId: deleteSchema
       parameters:
         - name: clusterName
           in: path
@@ -400,17 +407,15 @@ paths:
       responses:
         200:
           description: OK
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  type: integer
-    post:
+        404:
+          description: Not found
+
+  /api/clusters/{clusterName}/schemas/{schemaName}/versions:
+    get:
       tags:
         - /api/clusters
-      summary: create a new subject schema
-      operationId: createNewSchema
+      summary: get all version of schema from Schema Registry service
+      operationId: getSchemaVersions
       parameters:
         - name: clusterName
           in: path
@@ -422,20 +427,15 @@ paths:
           required: true
           schema:
             type: string
-      requestBody:
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/NewSchemaSubject'
       responses:
         200:
-          description: Updated
+          description: OK
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/SchemaSubject'
-        400:
-          description: Bad request
+                type: array
+                items:
+                  type: integer
 
   /api/clusters/{clusterName}/schemas/{schemaName}/latest:
     get: