nelmio/NelmioApiDocBundle — pull request #199 by jhallbachner (2013-06-12 01:20:51+00:00)
Title: Added support for Symfony Validation Component

Especially with the addition of automatic deserialization (and possibly soon automatic validation) of request objects to the FOSRestBundle, using a single PHP object with serialization and validation metadata is a pretty straightforward method for defining an API request format in Symfony. ApiDocBundle currently supports the parameter part of this via the JmsSerializerParser but doesn't capture details that are set via the validation component; thus, this pull request.

This PR adds a secondary "handler" to the parsing process, which extracts certain details (primarily required status, type, and format) from Symfony validation metadata on request objects and merges these details into the generated documentation spec. It also adds an additional column ("format") in the output for parameters which reflects constraints drawn from validation.

I also added a set of tests to verify that the metadata was being read and processed correctly.

The format used in the "format" column should be considered WIP.