[ 
https://issues.apache.org/jira/browse/NIFI-5728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16671566#comment-16671566
 ] 

ASF GitHub Bot commented on NIFI-5728:
--------------------------------------

Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/3098#discussion_r230024436
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/xml/TestXMLRecordSetWriter.java
 ---
    @@ -116,6 +124,34 @@ public void testRootAndRecordNaming() throws 
IOException, InitializationExceptio
             assertThat(expected, 
CompareMatcher.isSimilarTo(actual).ignoreWhitespace().withNodeMatcher(new 
DefaultNodeMatcher(ElementSelectors.byNameAndText)));
         }
     
    +    @Test
    +    public void testSchemaRootRecordNaming() throws IOException, 
InitializationException {
    +        String avroSchemaText = new 
String(Files.readAllBytes(Paths.get("src/test/resources/xml/testschema3")));;
    +        Schema avroSchema = new Schema.Parser().parse(avroSchemaText);
    +
    +        SchemaIdentifier schemaId = 
SchemaIdentifier.builder().name("schemaName").build();
    +        RecordSchema recordSchema = AvroTypeUtil.createSchema(avroSchema, 
avroSchemaText, schemaId);
    +
    +        XMLRecordSetWriter writer = new _XMLRecordSetWriter(recordSchema);
    +        TestRunner runner = setup(writer);
    +
    +        runner.setProperty(writer, XMLRecordSetWriter.ROOT_TAG_NAME, 
"ROOT_NODE");
    +        //runner.setProperty(writer, XMLRecordSetWriter.RECORD_TAG_NAME, 
"RECORD_NODE");
    --- End diff --
    
    to remove?


> Inconsistent behavior in XMLRecordSetWriter for Root Record Tag
> ---------------------------------------------------------------
>
>                 Key: NIFI-5728
>                 URL: https://issues.apache.org/jira/browse/NIFI-5728
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.7.1
>            Reporter: Ed Berezitsky
>            Assignee: Ed Berezitsky
>            Priority: Major
>
> In XMLRecordSetWriter:
> When used with "Use Schema Text" and "Name of Record Tag" is empty (so record 
> name should be used to wrapping XML tag) - works correctly.
> When used with Schema Registry and "Name of Record Tag" is empty - it doesn't 
> write record name, but uses schema name instead. I believe this inconsistency 
> is coming from the fact that when schema in a writer defined by "Use Schema 
> Text" - it doesn't have a name and then name is taken from a record. But when 
> it comes from registry - it simply uses schema idetifier:
> {code:java}
> recordSchema.getIdentifier().getName();
> {code}
> IMO root record name should be used in this case instead of schema name.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to