natesilva / jayschema

[Unmaintained] - A comprehensive JSON Schema validator for Node.js
BSD 3-Clause "New" or "Revised" License
217 stars 22 forks source link

Scheme url should be able to contain .. characters #28

Closed alexbirkett closed 10 years ago

alexbirkett commented 10 years ago

The following fails, but should work

describe('passing schema url directly to validate function should work', function () {

it('.. is legal in a url', function (done) {

       var schema = { 'type': 'integer', 'multipleOf': 8 };

        var loader = function (ref, callback) {
            process.nextTick(function () {
                ref.should.equal('homemadescheme://host.com/../path');
                callback(null, schema);
            });
        };

        var js = new JaySchema(loader);

        var instance = 64;

        js.validate(instance, "homemadescheme://host.com/../path", function(errs) {
            console.log(errs);
            should.not.exist(errs);
            done();
        });
    });