mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Changed types in schema for attributedValue and value to accept multiple types
This commit is contained in:
@@ -23,13 +23,13 @@ let barcode = Joi.object().keys({
|
|||||||
});
|
});
|
||||||
|
|
||||||
let field = Joi.object().keys({
|
let field = Joi.object().keys({
|
||||||
attributedValue: Joi.string().allow(""),
|
attributedValue: Joi.alternatives(Joi.string().allow(""), Joi.number(), Joi.date().iso()),
|
||||||
changeMessage: Joi.string().allow("").regex(/%@/),
|
changeMessage: Joi.string().allow("").regex(/%@/),
|
||||||
dataDetectorType: Joi.array().items(Joi.string().regex(/(PKDataDetectorTypePhoneNumber|PKDataDetectorTypeLink|PKDataDetectorTypeAddress|PKDataDetectorTypeCalendarEvent)/, "dataDetectorType")),
|
dataDetectorType: Joi.array().items(Joi.string().regex(/(PKDataDetectorTypePhoneNumber|PKDataDetectorTypeLink|PKDataDetectorTypeAddress|PKDataDetectorTypeCalendarEvent)/, "dataDetectorType")),
|
||||||
label: Joi.string().allow(""),
|
label: Joi.string().allow(""),
|
||||||
textAlignment: Joi.string().regex(/(PKTextAlignmentLeft|PKTextAlignmentCenter|PKTextAlignmentRight|PKTextAlignmentNatural)/, "graphic-alignment"),
|
textAlignment: Joi.string().regex(/(PKTextAlignmentLeft|PKTextAlignmentCenter|PKTextAlignmentRight|PKTextAlignmentNatural)/, "graphic-alignment"),
|
||||||
key: Joi.string().required(),
|
key: Joi.string().required(),
|
||||||
value: Joi.string().allow("").required()
|
value: Joi.alternatives(Joi.string().allow(""), Joi.number(), Joi.date().iso()).required()
|
||||||
});
|
});
|
||||||
|
|
||||||
let beaconsDict = Joi.object().keys({
|
let beaconsDict = Joi.object().keys({
|
||||||
@@ -70,7 +70,7 @@ module.exports = {
|
|||||||
let validation = Joi.validate(opts, schemaName);
|
let validation = Joi.validate(opts, schemaName);
|
||||||
|
|
||||||
if (validation.error) {
|
if (validation.error) {
|
||||||
debug(`validation failed due to :: ${validation.error.message}`);
|
debug(`validation failed due to error: ${validation.error.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !validation.error;
|
return !validation.error;
|
||||||
|
|||||||
Reference in New Issue
Block a user