-
-
Notifications
You must be signed in to change notification settings - Fork 768
/
Copy pathstrategy-schema.ts
27 lines (26 loc) · 963 Bytes
/
strategy-schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { nameType } from '../routes/util';
import joi from 'joi';
const strategySchema = joi
.object()
.keys({
name: nameType,
title: joi.string().allow(null).allow('').optional(),
disabled: joi.boolean().allow(null).optional(),
editable: joi.boolean().default(true),
deprecated: joi.boolean().default(false),
description: joi.string().allow(null).allow('').optional(),
parameters: joi
.array()
.required()
.items(
joi.object().keys({
name: joi.string().required(),
type: joi.string().required(),
description: joi.string().allow(null).allow('').optional(),
required: joi.boolean(),
}),
),
})
.options({ allowUnknown: false, stripUnknown: true, abortEarly: false });
export default strategySchema;
module.exports = strategySchema;