cOdeShagHennessy / microchasm

The microchasm library provides a conduit for rapidly composing microservice ecosystems through scaffolding mechanisms for the microchasm, microservices, microapis and other components as well as tooling for build, deployment, and other full stack services. Uses node, hapijs, slush, gulp, docker, docker-compose, etc. to incarnate microservices and microapis.
1 stars 0 forks source link

generated microlib schema validation does not return properly on validation error #3

Closed cOdeShagHennessy closed 9 years ago

cOdeShagHennessy commented 9 years ago

When a schema validation error occurs for a generated microlib the error is not properly return. This allows the generated tests to give false positives.

cOdeShagHennessy commented 9 years ago

Fixed in commit 0e348adc39c453c381972ee8045088c2c0dd166d with

var validateMethodOptions = function (methodOptions) {
    return Joi.validate(
        methodOptions,
        methodOptionsSchema, {abortEarly: false, allowUnknown: true}, function (err) {
            if (err) {
                Logger.error('Error: invalidated %j %s', methodOptions, err);
                return err;
            }
            Logger.trace('validated %j', methodOptions);
        });
};