RESOStandards / reso-certification-utils

NodeJS package with reference artifacts and ETL processes for Certification.
Other
1 stars 1 forks source link

Schema validation incorrectly reports the payload filename #184

Open jurbas-fbs opened 2 days ago

jurbas-fbs commented 2 days ago

Recently, the schema validation function started incorrectly reporting the payload filename.

I assume #175, #176 introduced this.

Example of the new schema validation report (with error)

schema --validate --payloadPath rcu/jobs/WN39/az/payload/Property.json --version 2.0 --resourceName Property --metadataPath rcu/jobs/WN39/az/metadata-report.processed.json

...

    {
      "resourceName": "Property",
      "fieldName": "Unit",
      "errors": [
        {
          "message": "Fields MUST be advertised in the metadata",
          "occurrences": [
            {
              "count": 8,
              "fileName": "1__Property.json",
              "sourceModel": "PropertyUnits",
              "sourceModelField": "UnitKey"
            }
          ]
        },
        {
          "message": "MUST be number or null but found string",
          "occurrences": [
            {
              "count": 8,
              "fileName": "1__Property.json",
              "sourceModel": "PropertyUnits",
              "sourceModelField": "UnitTypeActualRent"
            }
          ]
        }
      ],
      "warnings": []
    },

Notice that the fileName fields in the above output is incorrect:

Previous output

Previously, this was presented as:

    {
      "resourceName": "PropertyUnits",
      "fieldName": "UnitTypeActualRent",
      "errors": [
        {
          "message": "MUST be number or null but found string",
          "occurrences": [
            {
              "count": 75,
              "fileName": "Property.json"
            }
          ]
        }
      ],
      "warnings": []
    }
mohit-s96 commented 2 days ago

I think this change is from the branch 177-ignored-items-not-working-with-expansions. I have pushed a commit to fix this: 76a347999f449babad7ac554ba606283580952c5.