codeforkansascity / address-api

A address database accessible through an API that will return attributes about the address, neighborhood, council district, zoning...
http://address-api.codeforkc.org
MIT License
5 stars 9 forks source link

Adding Swagger documentation #89

Closed buzwells closed 8 years ago

buzwells commented 8 years ago

I've added a starter Swagger documentation file and the Swagger UI distribution. To make the UI accessible locally at http://dev-api.codeforkc.local/api-docs/, I added a symlink in webroot and modified the bootstrap.sh file to recognize index.html as a secondary but valid directory index. I also added a script (/data/scripts/fix_permissions.psql) to make it easier to fix permissions on setup. Simply navigate to /var/www/data/scripts on the vagrant box (within postgres) and issue the command "psql -f fix_permissions.psql". You'll have to key through a couple of pauses, but it's simpler than typing all the permission fixes in.

Not all of the endpoints have been documented. And many of the fields lack definitions. But this is hopefully a decent start.

Note: it appears that a column (land_bank_property) has been added to the Address.php base select but is not yet reflected in the db dumps. In order to make my calls work for testing the Swagger UI, I simply commented that column out of the select. But I thought I would pass that info along.

If this does not fit the vision for how to incorporate Swagger into the project, just let me know what you would like me to change. Thanks!

zmon commented 8 years ago

Can you update the install instructions and then do a pull request with them.

Looks great!

buzwells commented 8 years ago

I have some time today and will work on the install instructions. Thanks!

buzwells commented 8 years ago

New pull request is at https://github.com/codeforkansascity/address-api/pull/90