You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/11/01 12:44:00 UTC

[jira] [Commented] (NIFI-5728) Inconsistent behavior in XMLRecordSetWriter for Root Record Tag

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

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_r227674603
  
    --- Diff: nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/SimpleRecordSchema.java ---
    @@ -213,4 +215,30 @@ public String toString() {
         public SchemaIdentifier getIdentifier() {
             return schemaIdentifier;
         }
    +
    +    /**
    +     * Set schema name.
    +     * @param schemaName schema name as defined in a root record.
    +     */
    +    public void setSchemaName(String schemaName) {
    +        this.schemaName = schemaName;
    +    }
    +
    +    @Override
    +    public Optional<String> getSchemaName() {
    +        return Optional.ofNullable(schemaName);
    +    }
    +
    +    /**
    +     * Set schema namespace.
    +     * @param schemaNamespace schema name as defined in a root record.
    --- End diff --
    
    schema namespace


> 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)