mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Fix tests, fix markdown/html requirements output
This commit is contained in:
parent
cca97cf6af
commit
a8e0b24b95
@ -46,6 +46,7 @@ class MarkdownFormatter extends AbstractFormatter
|
||||
if (!empty($infos['type'])) {
|
||||
$markdown .= sprintf(" - Type: %s\n", $infos['type']);
|
||||
}
|
||||
|
||||
if (!empty($infos['description'])) {
|
||||
$markdown .= sprintf(" - Description: %s\n", $infos['description']);
|
||||
}
|
||||
@ -61,7 +62,7 @@ class MarkdownFormatter extends AbstractFormatter
|
||||
$markdown .= sprintf("%s:\n\n", $name);
|
||||
|
||||
foreach ($filter as $key => $value) {
|
||||
$markdown .= sprintf(" * %s: %s\n", $key, trim(json_encode($value), '"'));
|
||||
$markdown .= sprintf(" * %s: %s\n", ucwords($key), trim(str_replace('\\\\', '\\', json_encode($value)), '"'));
|
||||
}
|
||||
|
||||
$markdown .= "\n";
|
||||
|
@ -72,7 +72,7 @@
|
||||
{% for key, value in infos %}
|
||||
<tr>
|
||||
<td>{{ key|title }}</td>
|
||||
<td>{{ value|json_encode|trim('"') }}</td>
|
||||
<td>{{ value|json_encode|replace({'\\\\': '\\'})|trim('"') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
@ -34,12 +34,12 @@ _index action_
|
||||
|
||||
a:
|
||||
|
||||
* dataType: integer
|
||||
* DataType: integer
|
||||
|
||||
b:
|
||||
|
||||
* dataType: string
|
||||
* arbitrary: ["arg1","arg2"]
|
||||
* DataType: string
|
||||
* Arbitrary: ["arg1","arg2"]
|
||||
|
||||
|
||||
### `GET` /tests ###
|
||||
@ -50,12 +50,12 @@ _index action_
|
||||
|
||||
a:
|
||||
|
||||
* dataType: integer
|
||||
* DataType: integer
|
||||
|
||||
b:
|
||||
|
||||
* dataType: string
|
||||
* arbitrary: ["arg1","arg2"]
|
||||
* DataType: string
|
||||
* Arbitrary: ["arg1","arg2"]
|
||||
|
||||
|
||||
### `POST` /tests ###
|
||||
@ -167,8 +167,8 @@ _This method is useful to test if the getDocComment works._
|
||||
|
||||
page:
|
||||
|
||||
* requirement: \d+
|
||||
* description: Page of the overview.
|
||||
* Requirement: \d+
|
||||
* Description: Page of the overview.
|
||||
MARKDOWN;
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
@ -191,12 +191,12 @@ _index action_
|
||||
|
||||
a:
|
||||
|
||||
* dataType: integer
|
||||
* DataType: integer
|
||||
|
||||
b:
|
||||
|
||||
* dataType: string
|
||||
* arbitrary: ["arg1","arg2"]
|
||||
* DataType: string
|
||||
* Arbitrary: ["arg1","arg2"]
|
||||
|
||||
|
||||
MARKDOWN;
|
||||
|
Loading…
x
Reference in New Issue
Block a user