pydantic-sqlalchemy icon indicating copy to clipboard operation
pydantic-sqlalchemy copied to clipboard

Pydantic not enforcing maximum column length

Open ajawu opened this issue 4 years ago • 0 comments

` class User(db.Model): tablename = 'user' id = db.Column(db.Integer, autoincrement=True, primary_key=True) first_name = db.Column(db.String(40), nullable=False) last_name = db.Column(db.String(40), nullable=False)

UserSchema = sqlalchemy_to_pydantic(User, exclude=['id'])

UserSchema doesn't enforce the maximum length on the first_name and last_name fields. `

ajawu avatar Aug 07 '21 17:08 ajawu