Skip to content

Commit

Permalink
fix #524
Browse files Browse the repository at this point in the history
  • Loading branch information
mStirner committed Jan 18, 2025
1 parent f385025 commit cc52ecc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/plugins/class.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ module.exports = class Plugin extends Item {
name: Joi.string().required(),
uuid: Joi.string().default(() => {
return uuid.v4();
}).messages({
"any.invalid": `{{#label}} needs to be a valid v4 UUID`
}).custom((value, helpers) => {

if (!uuid.validate(value) || uuid.version(value) !== 4) {
return helpers.error("any.invalid");
}

return value;

}),
version: Joi.string().required().messages({
"any.invalid": `{{#label}} needs to be a valid semver version`
Expand Down

0 comments on commit cc52ecc

Please sign in to comment.