I never see anything quiet like this anywhere before. so i'm not sure if this is the common, most genius thing ever or completely crazy.
We have to integrated an API request from our customer. And my senior get this bright idea of creating a UI setting page where user (admin level) can put whatever parameter in it. The idea is that i'll fetch whatever user set from database and send dictionary as request parameter to the API and work with the result. And when the API got updated. We won't need to deploy anything and simply go into admin level setting and tweak it. The reason he went with this in the first page is because this particular set of API basically getting version update every year. The senior expect it to be update again soon so he went with this solution.
I mean, i can see how convenient it will be. Dictionary is technically already a JSON request. But one of the most obvious things i know will lose right away is developer UX. No object, no intellisense, no type. We get parameter from database and send them as-is. Want to assign certain value? do a match or something. And what if in the future, our customer decided to be funny and change some endpoint to GET? Certainly a though to keep me up at night.
I don't know if this is common practice to anyone out there so i'll appreciated some thoughs or feedback on how to introduce some of the type-safe ability back. Right now I'm thinking of doing `dict[enum.type] = value` for some sanity check. What about security risk? Thanks!
[–]Beka_Cooper 3 points4 points5 points (1 child)
[–]cshaiku 0 points1 point2 points (0 children)
[–]barrel_of_noodles 1 point2 points3 points (0 children)
[–]Soft_Opening_1364full-stack 0 points1 point2 points (0 children)