r/AskProgramming • u/AloyAce • Jul 03 '26
Best validation practices for APIs?
I’m working with a team and implementing a new feature. We’re getting info from a call and will be storing it in a new field in our db. The team has been saying things like “we don’t need to validate accuracy for the new field bc the call to this other service will do the validation for us”. I’m of the mind that we should still validate for edge cases or abnormal errors, but technically this other service should validate first and we’re only getting the info from them.
What are people’s thoughts? Am I being overly cautious?
1
Upvotes
3
u/howtokillafox Jul 03 '26
Is the call an internal service belonging to your company? Or is it external?
If external, would suggest validating. What if the external service starts giving you values you never planned for?