This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d04ba5427 NIFI-10529 Add DynamicProperties to AvroSchemaRegistry
8d04ba5427 is described below

commit 8d04ba5427e38adedfd541423de9ff07bb4877ba
Author: Bryan Bende <[email protected]>
AuthorDate: Tue Sep 20 16:28:43 2022 -0400

    NIFI-10529 Add DynamicProperties to AvroSchemaRegistry
    
    Signed-off-by: Pierre Villard <[email protected]>
    
    This closes #6436.
---
 .../org/apache/nifi/schemaregistry/services/AvroSchemaRegistry.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/src/main/java/org/apache/nifi/schemaregistry/services/AvroSchemaRegistry.java
 
b/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/src/main/java/org/apache/nifi/schemaregistry/services/AvroSchemaRegistry.java
index 58692782df..e1c3bdc26f 100644
--- 
a/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/src/main/java/org/apache/nifi/schemaregistry/services/AvroSchemaRegistry.java
+++ 
b/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/src/main/java/org/apache/nifi/schemaregistry/services/AvroSchemaRegistry.java
@@ -17,6 +17,7 @@
 package org.apache.nifi.schemaregistry.services;
 
 import org.apache.avro.Schema;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
 import org.apache.nifi.annotation.documentation.Tags;
 import org.apache.nifi.avro.AvroTypeUtil;
@@ -49,6 +50,9 @@ import java.util.concurrent.ConcurrentMap;
 @CapabilityDescription("Provides a service for registering and accessing 
schemas. You can register a schema "
     + "as a dynamic property where 'name' represents the schema name and 
'value' represents the textual "
     + "representation of the actual schema following the syntax and semantics 
of Avro's Schema format.")
+@DynamicProperty(name = "Schema name", value = "Schema Content",
+        description = "Adds a named schema using the JSON string 
representation of an Avro schema",
+        expressionLanguageScope = ExpressionLanguageScope.NONE)
 public class AvroSchemaRegistry extends AbstractControllerService implements 
SchemaRegistry {
     private static final Set<SchemaField> schemaFields = 
EnumSet.of(SchemaField.SCHEMA_NAME, SchemaField.SCHEMA_TEXT, 
SchemaField.SCHEMA_TEXT_FORMAT);
     private final ConcurrentMap<String, RecordSchema> recordSchemas = new 
ConcurrentHashMap<>();
@@ -149,7 +153,7 @@ public class AvroSchemaRegistry extends 
AbstractControllerService implements Sch
             .required(false)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .dynamic(true)
-            
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+            .expressionLanguageSupported(ExpressionLanguageScope.NONE)
             .build();
     }
 

Reply via email to