Skip to main content

Inconsistent API Functionality

I suspect this is custom validation used across many API endpoints, but I specifically refer to the People Memberships endpoint (i.e. PUT to /people/:person_id/memberships) The validator rejects null values for expires_on, and will only accept strings. If we want to set expires_on to null, we must send it a non-date string. The API will reject "expires_on": null with an error, but will return "expires_on": null if the attribute sent is "expires_on": "". Further, the validator does not catch non-date strings. Sending "expires_on": "donuts" also results in the response "expires_on": null. Really, the output should match the input, and the date validator should check to see whether the attribute sent matches a valid value (i.e. ISO8601 date or null). Instead, the validator only rejects null values and the API translates any non-ISO8601 string to null.

Share this post

Showing 2 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.