32 Commits

Author SHA1 Message Date
Ilyas Salikhov
abbf032483 Remove unused argument 2024-10-01 17:43:18 +03:00
Ilyas Salikhov
3ef60f2926 remove JmsSecurityExtraHandler 2024-10-01 17:30:02 +03:00
Ilyas Salikhov
e97eba7c1b Remove the support of fos-rest 2024-10-01 17:18:04 +03:00
Ilyas Salikhov
e06fb926f5 Fix code by php-cs-fixer 2024-10-01 15:54:04 +03:00
Ilyas Salikhov
6334d2e40f Removed support of sensio/framework-extra-bundle 2024-09-30 21:23:38 +03:00
Denys Pasishnyi
725e4d9dda #502 Hide Requirement when not set 2016-06-13 00:29:59 +02:00
Zhukov Roman
f2fc6b47c0 Fix Array to string conversion error on array requirements
Fixes #564
2016-02-01 14:33:17 +03:00
Damien Alexandre
306f2c47cf Fix Array to string conversion error on array requirements
Fix https://github.com/nelmio/NelmioApiDocBundle/issues/773
See https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1015
2016-01-08 13:04:25 +01:00
Ener-Getick
5541412e69 Fix FOSRestBundle compatibility 2015-12-02 16:19:24 +01:00
Baptiste Lafontaine
213dbdfd1c Handle "array" parameter in FOSRestBundle QueryParam or RequestParam 2015-06-08 08:43:38 +02:00
Damien Alexandre
a939fef59b Fix the PhpDoc Handler for @link annotation and add tests 2014-12-12 16:13:55 +01:00
Loick Piera
16b104edec Added support for Security annotation 2014-08-28 00:12:34 +02:00
Sergey Polischook
3e6a47818e Update PhpDocHandler.php
https://github.com/nelmio/NelmioApiDocBundle/issues/477
2014-08-16 01:59:39 +03:00
Bez Hermoso
882f658599 Added 'default' parameters in {JmsMetadata,Validator}Parser, and FOSRestHandler. 2014-06-27 10:19:28 +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
William DURAND
667044863c Fix HTTPS detection
Fix #281
2014-01-20 14:18:02 +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
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
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
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
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
marapper
80b5162c83 Add @QueryParam default support 2013-05-06 10:04:13 +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
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
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