mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-13 04:59:24 +03:00
Merge pull request #555 from damienalexandre/fixLinkParser
Fix the PhpDoc Handler for `@link` annotation and add tests
This commit is contained in:
commit
a84c53bf6a
@ -70,10 +70,10 @@ class PhpDocHandler implements HandlerInterface
|
|||||||
if (preg_match('{^@param (.+)}', trim($line), $matches)) {
|
if (preg_match('{^@param (.+)}', trim($line), $matches)) {
|
||||||
$paramDocs[] = $matches[1];
|
$paramDocs[] = $matches[1];
|
||||||
}
|
}
|
||||||
if (preg_match('{^@deprecated\b(.*)}', trim($line), $matches)) {
|
if (preg_match('{^@deprecated}', trim($line))) {
|
||||||
$annotation->setDeprecated(true);
|
$annotation->setDeprecated(true);
|
||||||
}
|
}
|
||||||
if (preg_match('{^@link\b(.*)}', trim($line), $matches)) {
|
if (preg_match('{^@link (.+)}', trim($line), $matches)) {
|
||||||
$annotation->setLink($matches[1]);
|
$annotation->setLink($matches[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,4 +314,12 @@ class TestController
|
|||||||
public function exclusiveAction()
|
public function exclusiveAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiDoc()
|
||||||
|
* @link http://symfony.com
|
||||||
|
*/
|
||||||
|
public function withLinkAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,11 +226,16 @@ test_required_parameters:
|
|||||||
requirements:
|
requirements:
|
||||||
_method: POST
|
_method: POST
|
||||||
_format: json|xml|html
|
_format: json|xml|html
|
||||||
|
|
||||||
test_put_disables_required_parameters:
|
test_put_disables_required_parameters:
|
||||||
pattern: /api/other-resources/{id}.{_format}
|
pattern: /api/other-resources/{id}.{_format}
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Resource:requiredParametersAction, _format: json }
|
defaults: { _controller: NelmioApiDocTestBundle:Resource:requiredParametersAction, _format: json }
|
||||||
requirements:
|
requirements:
|
||||||
_method: PUT
|
_method: PUT
|
||||||
_format: json|xml|html
|
_format: json|xml|html
|
||||||
|
|
||||||
|
test_route_25:
|
||||||
|
pattern: /with-link
|
||||||
|
defaults: { _controller: NelmioApiDocTestBundle:Test:withLinkAction }
|
||||||
|
requirements:
|
||||||
|
_method: GET
|
Loading…
x
Reference in New Issue
Block a user