Repository: provectus/kafka-ui
Issue: Schema registry: Should not be possible to change a schema type during editing
Labels: type/bug
good first issue
scope/backend
scope/frontend
status/accepted
status/confirmed

Steps:
1. Schema 'AVRO' created
2. Open created schema
3. Select 'Edit Schema'
4. Try to change a type

Actual result:
3. It's possible to change a type of schema

<img width="1541" alt="Screenshot 2022-06-10 at 18 20 42" src="https://user-images.githubusercontent.com/79516954/173110078-89cf8ec9-8897-40be-bad8-2574301f7bca.png">

Expected result:
3. Should not be possible to change a type, so it's better to remove 'Type' from editing

Issue comments:
Hello there kshpilchyna! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
@VladSenyuta fyi. We had an e2e test for this or something.

Pull request review comments:
```suggestion
          description: upon updating a schema, the type of an existing schema can't be changed
```
made it a bit clearer
```suggestion
      description: upon updating a schema, the type of an existing schema can't be changed
```
```suggestion
      description: should be set for creating/updating schema subject
```

Patch that resolved the issue:
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index c603b9dcc90..f64d8ce4da7 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/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
diff --git a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx b/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx
index 01ab9802faf..a09f45a568c 100644
--- a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx
+++ b/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,


Test patch: