<br />
<span class="badge badge_<?php echo $RAML->getCurrentAction(); ?>"><?php echo $RAML->getCurrentAction(); ?></span>
<strong style="display: inline-block; font-size: 14px; padding-top: 5px;" class="text_<?php echo $RAML->getCurrentAction(); ?>"><?php echo $RAML->baseUri . $RAML->getCurrentPath(); ?></strong>
<br />
<p style="margin-top: 30px;"><?php echo $RAML->action()->get('description'); ?></p>
<?php if ($RAML->action()->get('queryParameters')->isArray()): ?>
<h3>Query Parameters</h3>
<table>
<thead>
<tr>
<td>Parameter</td><td>Type</td><td>Description</td>
</tr>
</thead>
<?php
foreach ($RAML->action()->get('queryParameters')->toArray() as $param => $details) {
?>
<tr>
<td><?php echo $param; ?></td><td><?php echo $details['type']; ?></td><td><?php echo $details['description']; ?></td>
</tr>
<?php } ?>
</table>
<?php endif; ?>
<?php if ($RAML->action()->get('body')->get('application/x-www-form-urlencoded')->get('formParameters')->isArray()): ?>
<h3>Form Parameters</h3>
<table>
<thead>
<tr>
<td>Parameter</td><td>Type</td><td>Description</td>
</tr>
</thead>
<?php
foreach ($RAML->action()->get('body')->get('application/x-www-form-urlencoded')->get('formParameters')->toArray() as $param => $details) {
?>
<tr>
<td><?php echo $param; ?></td><td><?php echo $details['type']; ?></td><td><?php echo $details['description']; ?></td>
</tr>
<?php } ?>
</table>
<?php endif; ?>
<?php if ($RAML->action()->get('body')->get('application/json')->get('schema')->get('properties')->isArray()): ?>
<h3>JSON Parameters</h3>
<table>
<thead>
<tr>
<td>Parameter</td><td>Type</td><td>Description</td>
</tr>
</thead>
<?php
$tmp = $RAML->action()->get('body')->get('application/json')->get('schema')->toArray();
if ($RAML->action()->get('body')->get('application/json')->get('schema')->isString()) {
$tmp = json_decode($RAML->action()->get('body')->get('application/json')->get('schema')->toString(), true);
}
foreach ($tmp['properties'] as $param => $details) {
?>
<tr>
<td><?php echo $param; ?></td><td><?php echo $details['type']; ?></td><td><?php echo $details['description']; ?></td>
</tr>
<?php } ?>
</table>
<?php endif; ?>
<h3>Response</h3>
<?php foreach ($RAML->path()->getResponses() as $code => $responses) { ?>
<tt><strong><?php echo $code; ?>:</strong></tt><br /><br />
<?php
foreach ($responses as $response) {
if (in_array($response['type'], array('example', 'schema'))) {
continue;
}
echo '<tt>' . $response['type'] . '</tt>';
if (isset($response['example'])):
?>
<div class="apiresponse">
<?php echo formatResponse($response['example']); ?>
</div>
<?php endif; ?>
<p> </p>
<?php
}
} ?>
<?php if (count($RAML->path()->getVerbs()) > 1): ?>
<h3>Other Endpoint Actions</h3>
<?php
foreach ($RAML->path()->getVerbs() as $verb) {
if ($verb == $RAML->getCurrentAction()) {
continue;
}
?>
<div style="float: left;">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?path=<?php echo $RAML->getCurrentPath(); ?>&action=<?php echo $verb; ?>" class="badge badge_<?php echo $verb; ?>"><?php echo $verb; ?></a>
</div>
<?php } ?>
<?php endif; ?>
|