Re:.NET 10
by robertlagrant on Wednesday November 12, 2025 @04:34AM
(#45898168)
No, that's not true. If you share code like this then you can do things like put the same validation code in the frontend and the backend: frontend to give a nice user experience, and backend to protect the endpoint.
[ Parent
| on HN ]
Re:.NET 10
by littlecranky67 on Wednesday November 12, 2025 @05:27AM
(#45898510)
OpenAPI does support patterns for fields and nullables/non-nullables - that already gets you very far regarding validation. A decently sophisticated generator (which don't exist IMHO) would generate the validation code for your respective language.
Re:.NET 10
by robertlagrant on Wednesday November 12, 2025 @06:37AM
(#45898922)
True, but you can get all the way to zero duplication if you write it directly and share that code.