APIs

Effective APIs

Points to remember in order to build robust APIs. 1. Validate date exists, not just the format. Most date format validators only verify the structure of a date, but not the validity of the date itself. In other words, the date 1989-02-29 would pass validation even 1989 is not a leap year. Therefore, it’s a good idea to parse the date string into a date type and respond with a descriptive error in case an Exception is thrown.