1
votes

I have made an extension of a Joi type and successfully tested it on a test Node.js application. I am trying now to incorporate this extension in Foxx, since it supports Joi, but it doesn't seem to work: calling "Joi.extend(extension)", which works in the test application fails in Foxx.

Is there a difference in the versions of Joi on NPM and Joi in Foxx? Is it actually possible to make extensions in the Foxx version of Joi?

1

1 Answers

0
votes

ArangoDB uses joi in version 9.2.0 (see github). Since this version already supports extend(extension) your extension should work. Keep in mind that extend returns a new joi instance rather than modifying the existing one.

You can use a different version of joi within your Foxx service by including it in the node_modules folder of your bundle.