CodeX
Published in

CodeX

How should your API handle data dependencies?

When two fields in a data structure are linked, usability can be tricky

So your team has designed an API that takes, as input, an address. You begin by internationalizing the address into country-neutral field names such as country, region, postalCode, city, and address.

Pop quiz: Which of these fields are required?

For country codes, you can mark the field as required and download an ISO 3166 library to validate API calls. But there’s more: In the US, the region field is also required, as it contains…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ted Spence

Ted Spence

1K Followers

Software development management, focusing on analytics and effective programming techniques.