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