Browse Source

allow api.pipService even though it will be ignored

pull/875/head
Stephen Hess 7 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({
flipNumberAndStreetCountries: Joi.array().items(Joi.string().regex(/^[A-Z]{3}$/))
}).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
services: 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
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) => {
var config = {
api: {
@ -449,8 +449,7 @@ module.exports.tests.api_validation = (test, common) => {
const result = Joi.validate(config, schema);
t.equals(result.error.details.length, 1);
t.equals(result.error.details[0].message, '"pipService" is not allowed');
t.notOk(result.error);
});

Loading…
Cancel
Save