You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(another unfortunate result is that we lose the stack trace into our code - despite preferring await over returning Promises, which we know can cause the call stack to be lost)
Due to complications with the latest version of npm, we've decided to upgrade from Objection v2 to the latest v3.
As part of the upgrade we've lost the ability to use the
format
option in the json schemas. We get errors like this:(another unfortunate result is that we lose the stack trace into our code - despite preferring
await
over returningPromise
s, which we know can cause the call stack to be lost)Our model code looks like this:
The offending line, although not specified in the stack trace, is obviously
email: { type: 'string', format: 'email' },
.We see that the latest version of
ajv
has moved validations toajv-formats
, and that callingaddFormats(ajv)
requires an instance ofajv
.We're not clear on how we update Objection's instance of
ajv
to useajv-formats
.What can we do to get the validations working again?
The text was updated successfully, but these errors were encountered: