DEV Community

Discussion on: Input Validation: Client-side or Server-side?

Collapse
 
leob profile image
leob • Edited

Absolutely, the challenge then becomes how to avoid coding (and maintaining) your validations twice, especially if you're not using the same programming language on the server as on the client. There are solutions for this, but TBH for this reason I often do server side validation only. Doing only client side validation isn't safe, obviously.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Generating swagger or openapi file (*.json / *.yaml) and use it in the client seems to be the closest way I know.

Thread Thread
 
leob profile image
leob

Yeah true, Swagger would be helpful