Open ganeshkharche12 opened 6 years ago
Specifically the schema in question looks like this:
const Person = Joi.object({
firstName: Joi.string().required(),
lastName: Joi.string().required(),
children: Joi.array().items(Joi.lazy(() => Person).description('Person schema'))
});
The relevant part of the stack trace is this:
Error: sorry, do not know how to convert unknown joi type: "lazy"
at convert (joi-to-json-schema/build/index.js:186:11)
at Array.forEach (native)
at Object.array (joi-to-json-schema/build/index.js:87:14)
at convert (joi-to-json-schema/build/index.js:225:32)
at joi-to-json-schema/build/index.js:167:43
at Array.forEach (native)
at Object.object (joi-to-json-schema/build/index.js:165:25)
ArangoDB is using joi 9.2.0 with version 2.3.0 of this library (but AFAICT 3.x also doesn't support lazy
).
Yeah all but certain lazy was not a thing when we wrote the initial version. I will take a look but this is an area where we could honestly use some help.
Hi, any news on this issue ?
Using JOI validation with lazy(fn) to check recursive validation. In this case swagger failed to load routes even all routes are working. Below are all the generated logs.
i already had opened this issue on github ArangoDB issues https://github.com/arangodb/arangodb/issues/6132