98 Commits

Author SHA1 Message Date
Ilyas Salikhov
84a4b0200f Doc generation for the specific API version 2014-10-22 14:38:40 +04:00
lucasvanlierop
f625d9671c Fixed disabling required for HTTP PUT requests 2014-09-29 16:49:25 +02:00
lucasvanlierop
eaaa54bf11 Fixed checking HTTP method type 2014-09-29 16:17:36 +02:00
Bez Hermoso
c56aceaef5 Updated regex pattern to base on http://fr2.php.net/manual/en/language.oop5.basic.php 2014-09-04 10:47:58 -07:00
Bez Hermoso
4b7dbcd478 Improved directive parsing, and separate test class for parsing directives. 2014-09-04 10:47:57 -07:00
Bez Hermoso
928a23e2c8 Updated regex pattern matching and added tests for parsing array<..> directives. 2014-09-04 10:47:57 -07:00
Bez Hermoso
f5c1b06807 Support for collections. 2014-09-04 10:47:57 -07:00
Bez Hermoso
06cfe9d48b Allow parsers to remove/replace root parameters. 2014-09-04 10:47:57 -07:00
Bez Hermoso
a8221d4515 Post-parser support for response map models. 2014-07-29 10:25:06 -07:00
Bez Hermoso
9d3c0a8c29 Swagger support:
Unified data types [actualType and subType]
Updated tests.
JMS parsing fixes; updated {Validator,FormType}Parser, FOSRestHandler, and AbstractFormatter, and updated DataTypes enum.
Modified dataType checking.
Updated tests.
Updated DataTypes enum.
Quick fix and added doc comments.
CS fixes.
Refactored FormTypeParser to produce nested parameters. Updated tests accordingly.
Logical and CS fixes.
Sub-forms and more tests.
Logical and CS fixes.
Swagger support: created formatter.
Configuration and resourcePath logic update.
ApiDoc annotation update. Updated formatter and added tests.
Parameter formatting.
Added tests for SwaggerFormatter.
Added  option in annotation, and the corresponding logic for parsing the supplied values and processing them in the formatter.
Routing update.
Updated tests.
Removed unused dependency and updated doc comments.
Renamed 'responseModels' to 'responseMap'
Update the resource filtering and formatting of response messages.
Updated check for 200 response model.
Ignore data_class and always use form-type to avoid conflicts.
Fix: add 'type' even if '' is specified.
Refactored responseMap; added parsedResponseMap. Added tests and updated some.
Fix: add 'type' even if '' is specified.
Initial commit of command.
Finished logic for dumping files.
Updated doc comment; added license and added more meaningful class comment.
Array of models support.
2014-07-29 10:25:06 -07:00
Bez Hermoso
bb723bdb40 Added new tests for Swagger doc controllers. Also some CS fixes. 2014-07-29 10:25:06 -07:00
Bez Hermoso
6f85aed33c Swagger support:
Unified data types [actualType and subType]
Updated tests.
JMS parsing fixes; updated {Validator,FormType}Parser, FOSRestHandler, and AbstractFormatter, and updated DataTypes enum.
Modified dataType checking.
Updated tests.
Updated DataTypes enum.
Quick fix and added doc comments.
CS fixes.
Refactored FormTypeParser to produce nested parameters. Updated tests accordingly.
Logical and CS fixes.
Sub-forms and more tests.
Logical and CS fixes.
Swagger support: created formatter.
Configuration and resourcePath logic update.
ApiDoc annotation update. Updated formatter and added tests.
Parameter formatting.
Added tests for SwaggerFormatter.
Added  option in annotation, and the corresponding logic for parsing the supplied values and processing them in the formatter.
Routing update.
Updated tests.
Removed unused dependency and updated doc comments.
Renamed 'responseModels' to 'responseMap'
Update the resource filtering and formatting of response messages.
Updated check for 200 response model.
Ignore data_class and always use form-type to avoid conflicts.
Fix: add 'type' even if '' is specified.
Refactored responseMap; added parsedResponseMap. Added tests and updated some.
Fix: add 'type' even if '' is specified.
Initial commit of command.
Finished logic for dumping files.
Updated doc comment; added license and added more meaningful class comment.

Array of models support.
2014-07-29 10:25:05 -07:00
Bez Hermoso
882f658599 Added 'default' parameters in {JmsMetadata,Validator}Parser, and FOSRestHandler. 2014-06-27 10:19:28 +02:00
William Durand
0d1bde9f8a Merge pull request #352 from sroze/output-post-parser
Add PostParserInterface to JmsMetadataParser to get ValidatorParser found children parsed
2014-06-27 10:14:51 +02:00
Bez Hermoso
14d1021c8b Unified data types [actualType and subType]
This is the result of https://github.com/nelmio/NelmioApiDocBundle/issues/410.

This PR aims to provide a uniform way of declaring data-types of parameters for
parsers and handlers to follow. In turn, this would allow formatters to
determine data-types in a cleaner and less volatile manner. (See use-case that
can be improved with this PR:
https://github.com/nelmio/NelmioApiDocBundle/blob/master/Formatter/AbstractFormatter.php#L103)

This is possible by the addition two properties to each property item in
`response`, and `parameters` fields in each API endpoint produced by the
`ApiDocExtractor`:

* `actualType` Contains a value from one of the `DataTypes` class constants.

* `subType` Can contain either `null`, or any other `DataTypes` class constant.
This is relevant when the `actualType` is a `DataTypes::COLLECTION`, wherein
`subType` would specify the type of the collection items. It is also relevant
when `actualType` is a `DataTypes::MODEL`, wherein `subType` would contain an
identifier of the model (the FQCN or anything the parser would wish to specify)

Examples:

```php

array(
    'id' => array(
        'dataType' => 'integer',
        'actualType' => DataTypes::INTEGER,
        'subType' => null,
    ),
    'profile' => array(
        'dataType' => 'object (Profile)',
        'actualType' => DataTypes::MODEL,
        'subType' => 'Foo\Entity\Profile',
        'children' => array(
            'name' => array(
                'dataType' => 'string',
                'actualType' => DataTypes::STRING,
                'subType' => null,
             ),
            'birthDate' => array(
                'dataType' => 'date',
                'actualType' => DataTypes::DATE,
                'subType' => null,
            ),
        )
    ),
    'languages' => array(
        'dataType' => 'array of strings',
        'actualType' => DataTypes::COLLECTION,
        'subType' => DataTypes::STRING,
    ),
    'roles' => array(
        'dataType' => 'array of choices',
        'actualType' => DataTypes::COLLECTION,
        'subType' => DataTypes::ENUM,
    ),
    'groups' => array(
        'dataType' => 'array of objects (Group)',
        'actualType' => DataTypes::COLLECTION,
        'subType' => 'Foo\Entity\Group',
    ),
    'profileRevisions' => array(
         'dataType' => 'array of objects (Profile)',
         'actualType' => DataTypes::COLLECTION,
         'subType' => 'Foo\Entity\Profile',
    ),
    'address' => array(
        'dataType' => 'object (a_type_a_custom_JMS_serializer_handler_handles)',
        'actualType' => DataTypes::MODEL,
        'subType' => 'a_type_a_custom_JMS_serializer_handler_handles',
    ),
);
```

When a formatter omits the `dataType` property or leaves it blank, it is
inferred within `ApiDocExtractor` before everything is passed to formatters.
2014-06-25 09:05:48 +02:00
Samuel ROZE
3f66888f00 Add PostParserInterface to JmsMetadataParser to get ValidatorParser found children parsed. 2014-03-20 16:39:36 +01:00
jdeveloper
dea78901a0 Added exclude_envs to ApiDoc annotation to exclude the documentation from the specified environments 2014-01-20 13:24:41 +01:00
Max Romanovsky
e4ec8e79f3 Fixed ApiDoc for controllers enhanced with JMS CG with Doctrine Common 2014-01-13 19:10:07 +03:00
William Durand
393dbaf6ed Merge pull request #282 from sroze/patch-1
Fix PHPDoc
2013-12-28 09:43:50 -08:00
William DURAND
627130637d Merge PR #288 from piotrantosik/feature/selectparsers 2013-12-28 18:42:51 +01:00
Piotr Antosik
3fdbfbed1c select used parsers 2013-12-28 18:41:59 +01:00
Marc J. Schmidt
ead8174192 Outsourced the parsing of the classic phpDoc into a extra handler.
This makes it possible to overwrite route-requirements/description through a own handler.
Otherwise it's impossible e.g. to overwrite a `@param string $page` annotation via a own handler.
2013-12-11 01:40:16 +01:00
Samuel ROZE
95e8c9d200 Fix typo
$route parameter of ApiDocExtractor::get is a string. Passing a Route object throw an error.
2013-11-21 15:05:45 +01:00
Samuel ROZE
184a364fa4 Merge output parameters 2013-11-16 17:29:23 +01:00
William DURAND
d7fd929379 Fix CS 2013-11-14 10:33:57 +01:00
Florent DUBOST
f16aa64cf0 more readable 2013-10-11 16:40:26 +02:00
Florent DUBOST
56fdd4e64c Adding possibilty to name resource 2013-10-11 15:44:31 +02:00
William Durand
c2d36d9ef0 Merge pull request #221 from kmfk/documentation-in-handler
Modify the `documentation` property inside annotation handlers
2013-09-12 01:51:49 -07:00
Vincent CHALAMON
a1517543e8 Enable PHPDoc @link feature 2013-08-16 19:18:05 +02:00
keith kirk
f67dfb05db adds the ability to modify the documentation property inside custom extractor handlers 2013-07-25 13:47:54 -07:00
Josh Hall-Bachner
54a6ad566d Updated postParse logic to utilize an interface and to avoid unnecessary "supports" checks.
Expanded documentation on new classes and methods.
2013-07-02 21:57:09 -07:00
Josh Hall-Bachner
23f64b84f6 Fixed multi-level validation nesting.
Removed "class" parameters from results after processed.

Updated README.
2013-06-30 23:46:43 -07:00
Josh Hall-Bachner
5e1549a29d Built parse-merging into the ApiDocExtractor.
Wired up a "post-parse" pass to allow recursive parsing across multiple parsers.
2013-06-30 23:46:41 -07:00
Pierre-Yves LEBECQ
13efea8975 Added support for the jms version annotations in formatters 2013-05-12 14:54:01 +02:00
fieg
06271f824a added support for JMS Serializer GroupsExclusionStrategy 2013-05-12 14:29:36 +02:00
William Durand
5567f74692 Merge pull request #179 from lightglitch/fix-178
Fix parameter name boundary in regex
2013-05-06 01:00:51 -07:00
Jordi Boggiano
255d42830d Allow sf2.3, fix scope issue 2013-05-03 16:26:16 +02:00
William Durand
08eebf0fa0 Merge pull request #177 from fvilpoix/annotation_handlers
Moving annotation extraction into tagged Handlers
2013-04-17 15:21:31 -07:00
Mario Franco
b31ca81d9e Merge branch 'deprecated' 2013-04-16 16:40:34 +01:00
Mario Franco
bb9fd6d756 Added support for deprecated phpdoc tag 2013-04-16 16:19:19 +01:00
Mario Franco
32840bfe75 Fix parameter name boundary in regex 2013-04-16 16:16:30 +01:00
fvilpoix
76b85938c6 implementing all stof comments :) 2013-04-16 16:00:46 +02:00
fvilpoix
63b0f8e4da Moving annotation extraction into tagged Handlers 2013-04-12 17:43:27 +02:00
Patryk Kala
3b6e9da91a Ability to mark function as deprecated 2013-03-31 20:35:46 +02:00
William Durand
d6491e77bc Merge pull request #157 from fdubost/feature-cache
Add cache annotation extractor
2013-03-31 11:09:43 -07:00
Benjamin Bender
11a56251a4 Remove extra braces 2013-03-27 23:21:04 +01:00
Benjamin Bender
fd17706118 Cleanup docbook 2013-03-27 23:19:16 +01:00
Benjamin Bender
28b7fa7d0e Fixes typehint for Route 2013-03-27 22:28:26 +01:00
Benjamin Bender
8d771a925f Fix for #163. Makes Reflection on Route-objects more robust. 2013-03-27 19:36:42 +01:00
Jordi Boggiano
905ac99eb5 Fix handling of symfony 2.1 nested routes, fixes #163 2013-03-27 16:27:25 +01:00