18F / api-standards

API Standards for 18F
Other
486 stars 54 forks source link

Removing support for multiple formats #7

Closed konklone closed 10 years ago

konklone commented 10 years ago

I suggest we remove the recommendation to support multiple formats.

Supporting multiple output formats adds complexity to an API, and the benefits are not clear. As long as the API is producing information in a well-supported, machine-readable format, clients can be expected to write or use libraries that process it.

The added complexity is because it is non-trivial to "export" data to different formats without data-specific post-processing. Some examples:

Finally, multi-format zeal in Rails-world led to a security bug -- ActiveRecord's automatic parsing of various POSTed formats included YAML, and Ruby's YAML parser had a very bad security flaw.

Better to just pick a format, and stick with it. That's what most of the big APIs are doing these days, and it makes just as much sense for small APIs as big ones.

gbinal commented 10 years ago

Agreed.