We’re migrating from forest-express-sequelize
to @forestadmin/agent
.
With the previous agent, we used to rely on Sequelize field validations to get an instant feedback in the forest UI for the fields whose values were not correct.
But now, in the new agent, validations from the sequelize model are not reflected in the forestadmin-schema
as they were before.
As per this doc, the only validations that are brought are not-null
and length
.
Previously, a bigger set of validations was reported correctly. Eg: min
and max
:
But right now this very same validation (from the very same model) is ignored:
This is the model definition:
It looks like in your new implementation we’re supposed to manually implement the validation with the tools exposed by the new agent.
But you can easily understand that we’re not this happy about duplicating the validations in different parts of the code base.
Why aren’t you supporting these validations any more?
May you please tell which is the correct way to have these UI validations in place, without duplicating code (in the model and with the forest agent)?
Thank you in advance,
Matteo
Here is the “meta” section of the forest admin schema file:
{
"liana": "forest-nodejs-agent",
"liana_version": "1.41.7",
"liana_features": null,
"stack": {"engine": "nodejs", "engine_version": "20.11.1"}
}
and from package.json
:
"sequelize": "^6.28.0"