Browse Source

allow api.pipService even though it will be ignored

pull/875/head
Stephen Hess 8 years ago
parent
commit
28b459d9ba
  1. 2
      schema.js
  2. 5
      test/unit/schema.js

2
schema.js

@ -26,7 +26,7 @@ module.exports = Joi.object().keys({
localization: Joi.object().keys({ localization: Joi.object().keys({
flipNumberAndStreetCountries: Joi.array().items(Joi.string().regex(/^[A-Z]{3}$/)) flipNumberAndStreetCountries: Joi.array().items(Joi.string().regex(/^[A-Z]{3}$/))
}).unknown(false), }).unknown(false),
pipService: Joi.any().forbidden(), // got moved to services pipService: Joi.any(), // got moved to services, ignored for now
placeholderService: Joi.any().forbidden(), // got moved to services placeholderService: Joi.any().forbidden(), // got moved to services
services: Joi.object().keys({ services: Joi.object().keys({
pip: Joi.object().keys({ pip: Joi.object().keys({

5
test/unit/schema.js

@ -435,7 +435,7 @@ module.exports.tests.api_validation = (test, common) => {
}); });
// api.pipService has been moved to api.services.pip.url // api.pipService has been moved to api.services.pip.url
test('any api.pipService value should be disallowed', (t) => { test('any api.pipService value should be allowed', (t) => {
[null, 17, {}, [], true, 'http://localhost'].forEach((value) => { [null, 17, {}, [], true, 'http://localhost'].forEach((value) => {
var config = { var config = {
api: { api: {
@ -449,8 +449,7 @@ module.exports.tests.api_validation = (test, common) => {
const result = Joi.validate(config, schema); const result = Joi.validate(config, schema);
t.equals(result.error.details.length, 1); t.notOk(result.error);
t.equals(result.error.details[0].message, '"pipService" is not allowed');
}); });

Loading…
Cancel
Save