mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Add support in docblocks for @param with no description
This commit is contained in:
parent
3a7bf7ce41
commit
be3dca0c47
@ -94,7 +94,7 @@ abstract class AbstractFormatter implements FormatterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $paramDocs = $route->getOption('_paramDocs')) {
|
if (null !== $paramDocs = $route->getOption('_paramDocs')) {
|
||||||
$regexp = '{(\w*) *\$%s +(.*)}i';
|
$regexp = '{(\w*) *\$%s *(.*)}i';
|
||||||
foreach ($route->compile()->getVariables() as $var) {
|
foreach ($route->compile()->getVariables() as $var) {
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($paramDocs as $paramDoc) {
|
foreach ($paramDocs as $paramDoc) {
|
||||||
|
@ -59,6 +59,7 @@ class TestController
|
|||||||
* @ApiDoc()
|
* @ApiDoc()
|
||||||
*
|
*
|
||||||
* @param int $id A nice comment
|
* @param int $id A nice comment
|
||||||
|
* @param int $page
|
||||||
*/
|
*/
|
||||||
public function myCommentedAction()
|
public function myCommentedAction()
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ test_route_4:
|
|||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:any, _format: json }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:any, _format: json }
|
||||||
|
|
||||||
test_route_5:
|
test_route_5:
|
||||||
pattern: /my-commented/{id}
|
pattern: /my-commented/{id}/{page}
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:myCommented }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:myCommented }
|
||||||
|
|
||||||
test_route_6:
|
test_route_6:
|
||||||
|
@ -112,7 +112,7 @@ _Action without HTTP verb_
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### `ANY` /my-commented/{id} ###
|
### `ANY` /my-commented/{id}/{page} ###
|
||||||
|
|
||||||
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
|
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
|
||||||
|
|
||||||
@ -122,6 +122,9 @@ _This method is useful to test if the getDocComment works. And, it supports mult
|
|||||||
|
|
||||||
- Type: int
|
- Type: int
|
||||||
- Description: A nice comment
|
- Description: A nice comment
|
||||||
|
**page**
|
||||||
|
|
||||||
|
- Type: int
|
||||||
|
|
||||||
|
|
||||||
### `ANY` /yet-another/{id} ###
|
### `ANY` /yet-another/{id} ###
|
||||||
|
@ -149,10 +149,11 @@ class SimpleFormatterTest extends WebTestCase
|
|||||||
2 =>
|
2 =>
|
||||||
array(
|
array(
|
||||||
'method' => 'ANY',
|
'method' => 'ANY',
|
||||||
'uri' => '/my-commented/{id}',
|
'uri' => '/my-commented/{id}/{page}',
|
||||||
'requirements' =>
|
'requirements' =>
|
||||||
array(
|
array(
|
||||||
'id' => array('type' => 'int', 'description' => 'A nice comment', 'value' => '')
|
'id' => array('type' => 'int', 'description' => 'A nice comment', 'value' => ''),
|
||||||
|
'page' => array('type' => 'int', 'description' => '', 'value' => ''),
|
||||||
),
|
),
|
||||||
'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.',
|
'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.',
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user