Repository: provectus/kafka-ui
Issue: HTTP 500 on Global Compatibility Level change
Labels: type/bug
good first issue
scope/backend
status/accepted
status/confirmed
type/regression

**Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
If you try to change Global Compatibility Level you receive the error message '500 Internal Server Error
Unexpected internal error' and level doesn`t change.

**Set up**
<!--
(How do you run the app? 
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Navigate to local/Schema Registry
2. Choose a different Global Compatibility Level in dropdown menu
3. Observe: error message '500 Internal Server Error
Unexpected internal error' and level doesn`t change.

**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
The level has changed.

**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->


**Additional context**
<!--
(Add any other context about the problem here)
-->


Issue comments:

Pull request review comments:
I would also add `@nullable` annotation here
sure

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
index 6669d9d2b27..085e6c39be8 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
@@ -34,6 +34,7 @@
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
@@ -243,7 +244,7 @@ private Function<ClientResponse, Mono<? extends Throwable>> throwIfNotFoundStatu
    * @param schemaName is a schema subject name
    * @see com.provectus.kafka.ui.model.CompatibilityLevelDTO.CompatibilityEnum
    */
-  public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster, String schemaName,
+  public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster, @Nullable String schemaName,
                                               Mono<CompatibilityLevelDTO> compatibilityLevel) {
     String configEndpoint = Objects.isNull(schemaName) ? "/config" : "/config/{schemaName}";
     return configuredWebClient(
@@ -348,9 +349,9 @@ private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, Http
   }
 
   private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method,
-                                                        String uri, String uriVariable) {
-    return configuredWebClient(cluster, method, uri, List.of(uriVariable),
-        new LinkedMultiValueMap<>());
+                                                        String uri, @Nullable String uriVariable) {
+    List<String> uriVariables = uriVariable == null ? Collections.emptyList() : List.of(uriVariable);
+    return configuredWebClient(cluster, method, uri, uriVariables, new LinkedMultiValueMap<>());
   }
 
   private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster,


Test patch: