FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

More form constraints

Open samuelcolvin opened this issue 2 years ago • 2 comments

Currently we don't apply many common constraints from pydantic/json schema to forms:

  • max length / min length
  • gt, lt, ge, le
  • multiple of

Shouldn't be too hard to add these to the form field pydantic models, populate them in json_schema.py and add them to the input in the frontend.

samuelcolvin avatar Dec 01 '23 18:12 samuelcolvin

As far as I understand, these can all be validated - but currently only on the server side? I assume the benefit of also validating this client side is speed but I'm not sure if I'm missing any others.

WolfDWyc avatar Dec 02 '23 18:12 WolfDWyc

Yes

samuelcolvin avatar Dec 02 '23 18:12 samuelcolvin