100 Commits

Author SHA1 Message Date
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
Even André Fiskvik
b4e874e2dc Add support for nullable option in RequestParam 2014-06-25 10:19:30 +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
William DURAND
b48650a9e0 Fix CS 2014-06-25 08:52:01 +02:00
Loick Piera
d0149c65ab fix #357 2014-05-16 22:04:24 +02:00
Samuel ROZE
3f66888f00 Add PostParserInterface to JmsMetadataParser to get ValidatorParser found children parsed. 2014-03-20 16:39:36 +01:00
William DURAND
667044863c Fix HTTPS detection
Fix #281
2014-01-20 14:18:02 +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
6038fe842f Merge PR #299 from SimonSimCity/https-fixes
Fix #266
Close #283
Close #299
2013-12-28 18:55:06 +01:00
Simon Schick
912178dc88 Hide “_scheme” in the list of requirements per URL
+ disable sandbox if the scheme of the URL doesn’t match the scheme, the
documentation is opened in
2013-12-28 18:52:32 +01: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
William DURAND
c3097c7439 cs 2013-12-11 01:59: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
87328e27f5 Merge pull request #206 from dothiv/master
Show authorized roles in key icon tooltip
2013-11-14 11:17:06 +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
Eneko Illarramendi
fef656cd13 Not all "strict" params should be "Requirements" in the documentation
View https://github.com/nelmio/NelmioApiDocBundle/issues/229
2013-08-18 22:33:04 +02: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
Nils Wisiol
f764773c89 authenticationRoles can be set to appear in the tooltip of the key icon for API calls that require authentication. 2013-06-24 14:27:22 +02: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
marapper
80b5162c83 Add @QueryParam default support 2013-05-06 10:04:13 +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
Dave Keen
22508bf058 Update JmsSecurityExtraHandler.php
Having a JmsSecurity @PreAuthorize annotation should also count as setting a method as requiring authentication.
2013-04-29 12:10:42 +03: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
fvilpoix
3e04cbfdf1 [ExtractorHandler] code cleaning 2013-04-17 14:24:45 +02:00
fvilpoix
7f79ddc065 [ExtractorHandler] cleaning code 2013-04-17 13:41:28 +02: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