-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: unknown format "date-time" ignored in schema at path "#/properties/expires" #2249
Comments
Objection now uses
and then extend your model's import addFormats from "ajv-formats";
export default abstract class BaseModel extends Model {
static createValidator() {
return new AjvValidator({
onCreateAjv: (ajv) => {
addFormats(ajv);
},
options: {
allErrors: true,
validateSchema: false,
ownProperties: true,
},
});
}
} |
In this case, updating the guide would be required since the examples still follows the old system and the types still defines the old behaviour Thank you for replying, I'll be checking it as soon as possible |
This also happens for UUID. Specially if you are using one of the recommended plugins which is objection-guid. The fix works, but should be added into the native Model class then. |
I can second that, the missing format support for UUID took me by surprise! |
date-time
format is not working correctly in Objection 3.I'm working in a new project using a model structure I'm used to and can be found in this repo:
https://github.com/RodrigoNovais/rocketseat-nlw-3
The problematic model is
Tokens
, a use case can be found here.This syntax used to work in Objection 2.
Using Objection 3, attempting to insert a new token gives me this error:
Error: unknown format "date-time" ignored in schema at path "#/properties/expires"
My use case in the new project is pretty much the same.
I'm not sure if this error only relates to the specific 'date-time' format or if it expands for other strings formats.
If there's anything I can change in my code or even in the dependences by my own in order for it to work again it would be enough for me.
The text was updated successfully, but these errors were encountered: