Skip to main content

Posts

Showing posts from February, 2017

RESTFull GEOJson with Swagger and Slim

I often find myself having to write RESTFull api for small project.  So I have search and tried several tools. I finally choose to use  Swagger  to write the documentation and  Slim micro framework  to implements it. The first step is writing the yalm file in the Swagger editor (there is a nice tutorial at  Api Handyman  blog). With the yalm specification file it's simple to build an html documentation. Swagger have two pre build schema in html (html and html). You can export it, from Swagger Editor with Generate Client button (where you can export other languages client code).  To create the Slim skeleton, simply click on the Generate server button and choose Slim. Now you have two zip file that contains documentation and the skeleton code. Usually my project folder is composed by three subfolders: app (with the api code), api_doc (with the documentation generated by Swagger) and then an db_doc (the database documentation with diagram). To provide a geographic information