in reply to Re^2: Form generation and validation
in thread Form generation and validation

You can and should do some validation on the page in the user's browser, but as noted the real bulwark is the backend. On the other hand you can do it very close to the request arrival so your app doesn't really fire up unless needed. Since you are (rightly) concerned about strict param validation and it sounds like a serious app, I would start out right and create an OpenAPI spec for the app defining the routes and the acceptable params. There are plugins for Dancer which will build the whole app from the spec! And then validate the input if desired, etc. There's no reason to wait until the data is received by a route handler to validate it.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^4: Form generation and validation
by Anonymous Monk on Aug 01, 2019 at 11:24 UTC
    Thank you for linking me to OpenAPI specifications! This looks like an interesting idea to pursue, especially since I expect to provide some kind of API in addition to the web page in the future.