nikku / nikku/node-xsd-schema-validator
Validation failing with "invalid xml" for incorrect file path
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 23
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 1
Description
Describe the Bug
When providing the wrong path to a file, the error given is invalid xml (status=WITH_ERRORS). Nothing in the error points to the real problem: the path provided is not a file.
Steps to Reproduce
const validator = require('xsd-schema-validator');
const schemaFile = './path/to/schema.xsd';
const file = './foo.xml'; // Wrong path - file does not exist
validator.validateXML({ file }, schemaFile, function(err, result) {
if (err) throw err;
});
Expected Behavior
Error should give some indication that the file you're trying to test is not actually where you think it was.
Environment
- Node v14.16.0
- OS: Windows
- Version 0.7.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the validateXML entry point shown in the reproduction and trace how the provided file path is handled. Add coverage for the nonexistent-path case and verify that the resulting error identifies the missing file rather than reporting only invalid XML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100