浏览代码

Disable schemaType during schema edit (#2495)

* Disable schemaType during schema edit

Update Schema API documentation

closes #2197

* Apply suggestion


Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
Shubham Jain 2 年之前
父节点
当前提交
6df2d0b602

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

@@ -898,7 +898,7 @@ paths:
     post:
       tags:
         - Schemas
-      summary: create a new subject schema
+      summary: create a new subject schema or update existing subject schema
       operationId: createNewSchema
       parameters:
         - name: clusterName
@@ -2594,6 +2594,7 @@ components:
 
     NewSchemaSubject:
       type: object
+      description: should be set for creating/updating schema subject
       properties:
         subject:
           type: string
@@ -2601,6 +2602,7 @@ components:
           type: string
         schemaType:
           $ref: '#/components/schemas/SchemaType'
+          description: upon updating a schema, the type of an existing schema can't be changed
       required:
         - subject
         - schema
@@ -2624,6 +2626,7 @@ components:
 
     SchemaType:
       type: string
+      description: upon updating a schema, the type of an existing schema can't be changed
       enum:
         - AVRO
         - JSON

+ 1 - 1
kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx

@@ -124,7 +124,7 @@ const Edit: React.FC = () => {
                     value={schema.schemaType}
                     onChange={onChange}
                     minWidth="100%"
-                    disabled={isSubmitting}
+                    disabled
                     options={Object.keys(SchemaType).map((type) => ({
                       value: type,
                       label: type,