mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
8 years ago
|
'use strict';
|
||
|
|
||
|
const Joi = require('joi');
|
||
|
|
||
|
// Schema Configuration
|
||
|
// required:
|
||
|
// * api.version (string)
|
||
|
// * api.indexName (string)
|
||
|
// * api.host (string)
|
||
|
// * esclient (object - positive integer requestTimeout)
|
||
|
//
|
||
|
// optional:
|
||
|
// * api.accessLog (string)
|
||
|
// * api.relativeScores (boolean)
|
||
|
// * api.legacyUrl (string)
|
||
|
// * api.localization (flipNumberAndStreetCountries is array of 3 character strings)
|
||
8 years ago
|
module.exports = Joi.object().keys({
|
||
8 years ago
|
api: Joi.object().keys({
|
||
|
version: Joi.string(),
|
||
|
indexName: Joi.string(),
|
||
|
host: Joi.string(),
|
||
|
legacyUrl: Joi.string(),
|
||
|
accessLog: Joi.string(),
|
||
|
relativeScores: Joi.boolean(),
|
||
8 years ago
|
requestRetries: Joi.number().integer().min(0),
|
||
8 years ago
|
localization: Joi.object().keys({
|
||
|
flipNumberAndStreetCountries: Joi.array().items(Joi.string().regex(/^[A-Z]{3}$/))
|
||
|
}).unknown(false)
|
||
|
|
||
|
}).requiredKeys('version', 'indexName', 'host').unknown(true),
|
||
|
esclient: Joi.object().keys({
|
||
|
requestTimeout: Joi.number().integer().min(0)
|
||
|
}).unknown(true)
|
||
|
}).requiredKeys('api', 'esclient').unknown(true);
|