Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/raml2html/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.4",
"symfony/console": "^4.2",
"raml-org/raml-php-parser": "dev-master",
"twig/twig": "^2.0",
Expand Down
5 changes: 2 additions & 3 deletions tools/raml2html/src/Twig/Extension/RenderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public function getExamplesTabs(array $responseBodies): array

/** @var \Raml\Body $body */
foreach ($responseBodies as $body) {

if (!empty($body->getExample())) {
if (!empty($body->getExamples()) && !empty($body->getExample())) {
$tabs[] = $this->getSchemaFormat($body->getMediaType());
}
}
Expand All @@ -85,7 +84,7 @@ public function getExamplesBody(array $responseBodies): array
foreach ($responseBodies as $body) {
$schemaFormat = $this->getSchemaFormat($body->getMediaType());

if (!empty($body->getExample())) {
if (!empty($body->getExamples()) && !empty($body->getExample())) {
$examples[$schemaFormat][] = $body->getExample();
}
}
Expand Down