Remove message properties that were causing problems

This commit is contained in:
Oliver Akins 2022-07-20 21:23:38 -06:00
parent 13711e5986
commit b883c00247
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99

View file

@ -4,6 +4,8 @@ import Joi from "joi";
const schema = Joi.object({ const schema = Joi.object({
game: Joi.object({ game: Joi.object({
code_length: Joi.number().integer().positive(),
fuel_deck: Joi.object({
type: Joi type: Joi
.string() .string()
.allow( .allow(
@ -12,24 +14,21 @@ const schema = Joi.object({
// `web:json`, // `web:json`,
// `web:csv` // `web:csv`
) )
.required() .required(),
.message(`Invalid deck type`),
location: Joi location: Joi
.string() .string()
.required() .required(),
.message(`The deck location must be a string`), }),
}), }),
server: Joi.object({ server: Joi.object({
port: Joi port: Joi
.number() .number()
.port() .port()
.required() .required(),
.message(`Invalid port number`),
cors: Joi.object({ cors: Joi.object({
origins: Joi origins: Joi
.array() .array()
.items(Joi.string()) .items(Joi.string()),
.message(`The CORS origins must be an array of strings`),
}), }),
}), }),
log: Joi.object({ log: Joi.object({
@ -45,8 +44,7 @@ const schema = Joi.object({
`fatal` `fatal`
) )
.optional() .optional()
.default(`info`) .default(`info`),
.message(`Invalid log level`),
}), }),
}); });