Migration to @forestadmin/agent - min/max validations generated from sequelize models do not include the endpoints

Hello @Matteo,

I’m happy to annonce that we rework the agent and the sequelize datasource in order to correctly support min/max sequelize validators.

To be capable of this we did add a new required feature (two new well known operators: GreaterThanOrEqual & LessThanOrEqual along side the same validators). It’s a nice improvement too to meet industry standards.

Example done with Sequelize

Sequelize model
sequelize.define('place', {
  name: DataTypes.STRING,
  address: DataTypes.STRING,
  latitude: {
    type: DataTypes.INTEGER,
    validate: {
      min: -90,
      max: 90,
    },
  },
  longitude: {
    type: DataTypes.INTEGER,
    validate: {
      min: -180,
      max: 180,
    },
  },
});

Screenshot 2024-09-27 at 11.48.40

You can upgrade to the latest @forestadmin/datasource-sequelize version and also bump to the latest @forestadmin/agent version.

Let’s us know if it works for you.

Kind regards,
Morgan

2 Likes