nikku / node-xsd-schema-validator

A schema (XSD) validator for NodeJS
https://www.npmjs.com/package/xsd-schema-validator
MIT License
51 stars 24 forks source link

Validator hangs if something other than a string or readable stream is passed in as xml parameter #12

Closed ajkerr closed 7 years ago

ajkerr commented 7 years ago

Version 0.5.0 now hangs if something other than a stream, string, or Object with a file property is passed in for the xml parameter.

Other generic types of Objects used to be supported as well, and would just have their toString() output used as the XML.

We discovered this after upgrading to 0.5.0 because our code was passing in a Buffer returned from fs.readFile().

Happy to cook up a PR if it's helpful.

nikku commented 7 years ago

Buffers should be supported, too.

I'm happy to merge a PR adding official support :wink:.