diff --git a/broker/applications/osb-broker/src/api-controllers/middleware/index.js b/broker/applications/osb-broker/src/api-controllers/middleware/index.js index e4b04daaa..403f72817 100644 --- a/broker/applications/osb-broker/src/api-controllers/middleware/index.js +++ b/broker/applications/osb-broker/src/api-controllers/middleware/index.js @@ -233,16 +233,16 @@ exports.validateSchemaForRequest = function (target, operation) { validate = validator.compile(schema); const ajv04Validate = ajv04Validator.compile(schema); if (!ajv04Validate(parameters) && !validate(parameters)) { - let reason = _.map(validate.errors, ({ dataPath, message }) => `${dataPath} ${message}`).join(', '); + let reason = _.map(validate.errors, ({ instancePath, message }) => `${instancePath} ${message}`).join(', '); if (reason == '') { - reason = _.map(ajv04Validate.errors, ({ dataPath, message }) => `${dataPath} ${message}`).join(', '); + reason = _.map(ajv04Validate.errors, ({ instancePath, message }) => `${instancePath} ${message}`).join(', '); } return next(new InvalidServiceParameters(`Failed to validate service parameters, reason: ${reason}`)); } } else { const isValid = validate(parameters); if (!isValid) { - const reason = _.map(validate.errors, ({ dataPath, message }) => `${dataPath} ${message}`).join(', '); + const reason = _.map(validate.errors, ({ instancePath, message }) => `${instancePath} ${message}`).join(', '); return next(new InvalidServiceParameters(`Failed to validate service parameters, reason: ${reason}`)); } } diff --git a/broker/applications/osb-broker/test/acceptance/service-broker-api.instances.director.spec.js b/broker/applications/osb-broker/test/acceptance/service-broker-api.instances.director.spec.js index 8c8e02404..41e2c1f81 100644 --- a/broker/applications/osb-broker/test/acceptance/service-broker-api.instances.director.spec.js +++ b/broker/applications/osb-broker/test/acceptance/service-broker-api.instances.director.spec.js @@ -232,7 +232,7 @@ describe('service-broker-api', function () { .then(res => { expect(res).to.have.status(400); expect(res.body.error).to.be.eql('Bad Request'); - expect(res.body.description).to.be.eql('Failed to validate service parameters, reason: undefined must be equal to one of the allowed values'); + expect(res.body.description).to.be.eql('Failed to validate service parameters, reason: /enum_foo must be equal to one of the allowed values'); }); });