18F / fbopen

[DEPRECATED] An open API server, data import tools, and sample apps to help small businesses search for opportunities to work with the U.S. government.
Other
101 stars 45 forks source link

[WIP] A first crack at API backwards compatibility to v0 #179

Closed arowla closed 9 years ago

arowla commented 9 years ago

Our migration to Elasticsearch broke backwards compatibility with the original version of the API. Since it has now been so long since the release, and we now have clients depending on v0, we need to do proper API versioning (via URLs in this case). This adds code which morphs v1 results, which the new API had been returning by default, into v0-style results in response to a "v0" URL request.

I've also added a json-schema file to validate each version against in the tests, but the validation is wrongly passing every time, even when I try to make the v0 test go red by commenting out the bit in api/formatter.js that adds backward compatibility.

Run make test-api to run the relevant tests. Let me know if you need help getting things running, I know the docs have been getting crufty.

cc @jmcarp