mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
finished up, tests passing, fixed cs
This commit is contained in:
parent
2902ac3cbb
commit
504d5125f9
@ -85,6 +85,22 @@ class MarkdownFormatter extends AbstractFormatter
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($data['response'])) {
|
||||
$markdown .= "#### Response ####\n\n";
|
||||
|
||||
foreach ($data['response'] as $name => $parameter) {
|
||||
$markdown .= sprintf("%s:\n\n", $name);
|
||||
$markdown .= sprintf(" * type: %s\n", $parameter['dataType']);
|
||||
$markdown .= sprintf(" * required: %s\n", $parameter['required'] ? 'true' : 'false');
|
||||
|
||||
if (isset($parameter['description']) && !empty($parameter['description'])) {
|
||||
$markdown .= sprintf(" * description: %s\n", $parameter['description']);
|
||||
}
|
||||
|
||||
$markdown .= "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $markdown;
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,6 @@ class JmsMetadataParser implements ParserInterface
|
||||
|
||||
//TODO: regex comment to get description - or move doc comment parsing functionality from `ApiDocExtractor` to a new location
|
||||
//in order to reuse it here
|
||||
|
||||
return $description;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ class TestController
|
||||
/**
|
||||
* @ApiDoc(
|
||||
* description="Testing return",
|
||||
* return="test_type"
|
||||
* return="dependency_type"
|
||||
* )
|
||||
*/
|
||||
public function jmsReturnTestAction()
|
||||
|
@ -186,6 +186,19 @@ arr:
|
||||
* description: No description.
|
||||
|
||||
|
||||
### `GET` /jms-return-test ###
|
||||
|
||||
_Testing return_
|
||||
|
||||
#### Response ####
|
||||
|
||||
a:
|
||||
|
||||
* type: string
|
||||
* required: true
|
||||
* description: A nice description
|
||||
|
||||
|
||||
### `ANY` /my-commented/{id}/{page} ###
|
||||
|
||||
_This method is useful to test if the getDocComment works._
|
||||
|
@ -220,7 +220,12 @@ class SimpleFormatterTest extends WebTestCase
|
||||
'uri' => '/jms-return-test',
|
||||
'description' => 'Testing return',
|
||||
'response' => array(
|
||||
|
||||
'a' => array(
|
||||
'dataType' => 'string',
|
||||
'required' => true,
|
||||
'description' => 'A nice description',
|
||||
'readonly' => false
|
||||
)
|
||||
)
|
||||
),
|
||||
5 =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user