'use strict'; const joi = require('joi'); const countSchema = joi.object().options({ stripUnknown: true }).keys({ yes: joi.number().required().min(0).default(0), no: joi.number().required().min(0).default(0), }); const clientMetricsSchema = joi.object().options({ stripUnknown: true }).keys({ appName: joi.string().required(), instanceId: joi.string().required(), bucket: joi.object().required().keys({ start: joi.date().required(), stop: joi.date().required(), toggles: joi.object().pattern(/.*/, countSchema), }), }); module.exports = { clientMetricsSchema };