Skip to content

Commit

Permalink
Make the json schema extension use mandatory when the serialization c…
Browse files Browse the repository at this point in the history
…lasses are present
  • Loading branch information
carlesarnal committed Dec 13, 2023
1 parent 7cde63a commit 67d4b6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public interface Capability {

String APICURIO_REGISTRY = QUARKUS_PREFIX + ".apicurio.registry";
String APICURIO_REGISTRY_AVRO = APICURIO_REGISTRY + ".avro";
String APICURIO_REGISTRY_JSON_SCHEMA = APICURIO_REGISTRY + ".json";

String CONFLUENT_REGISTRY = QUARKUS_PREFIX + ".confluent.registry";
String CONFLUENT_REGISTRY_AVRO = CONFLUENT_REGISTRY + ".avro";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,19 @@ private void handleAvro(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
"java.lang.AutoCloseable"));
}

// --- Apicurio Registry 2.x ---
// --- Apicurio Registry 2.x Avro ---
if (QuarkusClassLoader.isClassPresentAtRuntime("io.apicurio.registry.serde.avro.AvroKafkaDeserializer")
&& !capabilities.isPresent(Capability.APICURIO_REGISTRY_AVRO)) {
throw new RuntimeException(
"Apicurio Registry 2.x Avro classes detected, please use the quarkus-apicurio-registry-avro extension");
}

// --- Apicurio Registry 2.x Json Schema ---
if (QuarkusClassLoader.isClassPresentAtRuntime("io.apicurio.registry.serde.avro.JsonKafkaDeserializer")
&& !capabilities.isPresent(Capability.APICURIO_REGISTRY_JSON_SCHEMA)) {
throw new RuntimeException(
"Apicurio Registry 2.x Json classes detected, please use the quarkus-apicurio-registry-json extension");
}
}

@BuildStep
Expand Down

0 comments on commit 67d4b6f

Please sign in to comment.