Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Ensure API endpoints have required params first #386

Merged
merged 1 commit into from
Jul 18, 2023
Merged
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
14 changes: 7 additions & 7 deletions app/views/docs/service.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,6 @@ if (!\function_exists('skipLanguage')) {
$security = $operation['security'][0] ?? '';
$platformsList = (isset($operation['platforms'])) ? array_map(function($node) {return 'example-for-'.$node;}, $operation['platforms']) : [];

usort($parameters, function ($a, $b) {
$x = (isset($a['required'])) ? $a['required'] : false;
$y = (isset($b['required'])) ? $b['required'] : false;

return $y - $x;
});

$rateKey = (is_array($rateKey)) ? implode(',', $rateKey) : $rateKey;

$rateKey = array_map(function($element)
Expand All @@ -336,6 +329,13 @@ if (!\function_exists('skipLanguage')) {
}
}

usort($parameters, function ($a, $b) {
$x = (isset($a['required'])) ? $a['required'] : false;
$y = (isset($b['required'])) ? $b['required'] : false;

return $y - $x;
});

?>
<div class="margin-bottom-large x-function" data-ls-attrs="class=margin-bottom-large x-function <?php echo implode(' ', $platformsList); ?>">
<div class="row responsive">
Expand Down