5 ms·
Sharing validation for forms is definitely really nice. It feels like it should be possible to do that cross-language, generating some JS validation rules from
by twic 5y ago
Sharing validation for forms is definitely really nice.
It feels like it should be possible to do that cross-language, generating some JS validation rules from Java annotations, say, but i have never seen it done.
- eyelidlessness 5y agoThe way it’s usually done is with a generalized language-agnostic spec like OpenAPI/JSON Schema. Because the definitions are standardized, you can effectively build tools in any language that should provide the same validation, to the extent they’re compliant and the spec is unambiguous. These approaches can of course be combined, where the sorts of validators I mentioned generate (or even build their primitives around) those more verbose standards.