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,32 +4,31 @@ import Joi from "joi";
const schema = Joi.object({ const schema = Joi.object({
game: Joi.object({ game: Joi.object({
type: Joi code_length: Joi.number().integer().positive(),
.string() fuel_deck: Joi.object({
.allow( type: Joi
`file:json`, .string()
// `file:csv`, .allow(
// `web:json`, `file:json`,
// `web:csv` // `file:csv`,
) // `web:json`,
.required() // `web:csv`
.message(`Invalid deck type`), )
location: Joi .required(),
.string() location: Joi
.required() .string()
.message(`The deck location must be a string`), .required(),
}),
}), }),
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`),
}), }),
}); });