You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "crissaegrim (Jira)" <ji...@apache.org> on 2023/05/21 12:11:00 UTC

[jira] [Created] (NIFI-11577) ValidateRecord fails to validate XML record of record and attributes; ConvertRecord recognises just fine

crissaegrim created NIFI-11577:
----------------------------------

             Summary: ValidateRecord fails to validate XML record of record and attributes; ConvertRecord recognises just fine
                 Key: NIFI-11577
                 URL: https://issues.apache.org/jira/browse/NIFI-11577
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
            Reporter: crissaegrim
         Attachments: image-2023-05-21-08-08-48-669.png

h1. Input Data
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<wd:Report_Entry xmlns:wd="urn:com.workday.report/CR_Pending_Hires_Trading_Candidates_Recon_Report">
   <wd:Req_ID>REQ-7602</wd:Req_ID>
   <wd:Job_Requisition Descriptor="REQ-7602 Trader (Open)">
      <wd:ID type="WID">91384a20a89001a955bb7ded1401271f</wd:ID>
      <wd:ID type="Job_Requisition_ID">REQ-7602</wd:ID>
   </wd:Job_Requisition>
<wd:wd:Report_Entry>
{code}
h1. Schema (avro)
{code:json}
{
  "type" : "record",
  "name" : "PendingHiresEntryType",
  "namespace" : "MLP.BDCore.Common.Model.Vertical1",
  "fields" : [ {
    "name" : "requisition_id",
    "type" : [ "null", "string" ],
    "default" : null,
    "aliases" : [ "Req_ID" ]
  }, {
    "name" : "job_requisition",
    "type" : [ "null", {
      "type" : "array",
      "items" : {
        "type" : "record",
        "name" : "WdDescribedIdType",
        "fields" : [ {
          "name" : "id_field",
          "type" : [ "null", {
            "type" : "array",
            "items" : {
              "type" : "record",
              "name" : "WdAttributedIdType",
              "fields" : [ {
                "name" : "content_value",
                "type" : [ "null", "string" ]
              }, {
                "name" : "type",
                "type" : "string"
              } ]
            }
          } ],
          "default" : null,
          "aliases" : [ "ID" ]
        }, {
          "name" : "description",
          "type" : [ "null", "string" ],
          "default" : null,
          "aliases" : [ "Descriptor" ]
        } ]
      }
    } ],
    "default" : null,
    "aliases" : [ "Job_Requisition" ]
  } ]
}
{code}
h1. Expected Output

It should successfully validate the record. Whereas `ConvertRecord` will successfully parse the record according to schema, `ValidateRecord` will report a failure.
h1. Actual Output

!image-2023-05-21-08-08-48-669.png!
h1. Output Data of ConvertRecord (using same schema, no changes)
{code:xml}
<?xml version="1.0" ?>
<PendingHiresEntryType>
  <requisition_id>REQ-7602</requisition_id>
  <job_requisition>
    <id_field>
      <content_value>91384a20a89001a955bb7ded1401271f</content_value>
      <type>WID</type>
    </id_field>
    <id_field>
      <content_value>REQ-7602</content_value>
      <type>Job_Requisition_ID</type>
    </id_field>
    <description>REQ-7602 Trader (Open)</description>
  </job_requisition>
</PendingHiresEntryType>
{code}
h1. Schema (IDL)
{code:java}
record WdAttributedIdType {
    string? content_value;
    string type;
}

record WdDescribedIdType {
    union {null, array<WdAttributedIdType>} @aliases(["ID"]) id_field = null;
    string? @aliases(["Descriptor"]) description = null;
}

record PendingHiresEntryType {
    string? @aliases(["Req_ID"]) requisition_id = null;
    union { null, array<WdDescribedIdType> } @aliases(["Job_Requisition"]) job_requisition = null;
}
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)