News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

VG Tech:
Swagger Docs in ZF2 with Examples - Part 1 Setup and Annotations
February 25, 2014 @ 10:33:48

The VG Tech blog has posted the first part of a series they're doing about Zend Framework 2 and Swagger, the auto-generating documentation project for APIs. In this first part of the series, they go through some setup and show the use of annotations to define the Swagger output.

So everyone is building APIs now - parsing and outputting JSON is not that hard. Some people even build truly RESTful APIs, or something not to far from that. Before, when building APIs was about SOAP with XML schemas and WSDL specifications, people spent so much time building their APIs that they had the time to think. Now, building an API is so easy and fast that the documentation is often suffering. [...] Swagger is a popular project providing auto generated API docs based on a service specification. This spec is based on annotation comments in the controllers and models, giving the developer a fairly easy, and close to the code way of keeping the API docs up to date.

He walks you through the process to clone and setup the Zend Framework 2 project first, then pull in the "outeredge/swagger-module" with Composer. This package provides the tools to generate Swagger output from annotations in the PHP code. He also shows you how to set up the Swagger UI project (wordnik/swagger-ui). Finally, he gets into the code examples, showing how to annotate models and use partials.

0 comments voice your opinion now!
swagger api zendframework setup annotation tutorial series part1

Link: http://tech.vg.no/2014/02/24/swagger-docs-in-zf2-with-examples-part-1-setup-and-annotations/

blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Debugging with Xdebug and Sublime Text 3

Martin Sikora's Blog: Silex + Doctrine 2 ORM

Zumba Engineering Blog: Creating bash completion to your console application

Mike Wallner's Blog: Introducing libcurls multi socket API

PHPit.net: Taking a first look at the AutoCRUD for PHP library


Community Events





Don't see your event here?
Let us know!


interview symfony library language opinion package podcast community laravel security introduction update install tool series release voicesoftheelephpant framework composer version

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework