]> BookStack Code Mirror - bookstack/blob - resources/views/api-docs/parts/endpoint.blade.php
Updated a batch of JS components
[bookstack] / resources / views / api-docs / parts / endpoint.blade.php
1 <h6 class="text-uppercase text-muted float right">{{ $endpoint['controller_method_kebab'] }}</h6>
2
3 <h5 id="{{ $endpoint['name'] }}" class="text-mono mb-m">
4     <span class="api-method" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
5     @if($endpoint['controller_method_kebab'] === 'list')
6         <a style="color: inherit;" target="_blank" rel="noopener" href="{{ url($endpoint['uri']) }}">{{ url($endpoint['uri']) }}</a>
7     @else
8         {{ url($endpoint['uri']) }}
9     @endif
10 </h5>
11
12 <p class="mb-m">{{ $endpoint['description'] ?? '' }}</p>
13
14 @if($endpoint['body_params'] ?? false)
15     <details class="mb-m">
16         <summary class="text-muted">{{ $endpoint['method'] === 'GET' ? 'Query' : 'Body'  }} Parameters</summary>
17         <table class="table">
18             <tr>
19                 <th>Param Name</th>
20                 <th>Value Rules</th>
21             </tr>
22             @foreach($endpoint['body_params'] as $paramName => $rules)
23                 <tr>
24                     <td>{{ $paramName }}</td>
25                     <td>
26                         @foreach($rules as $rule)
27                             <code class="mr-xs">{{ $rule }}</code>
28                         @endforeach
29                     </td>
30                 </tr>
31             @endforeach
32         </table>
33     </details>
34 @endif
35
36 @if($endpoint['example_request'] ?? false)
37     <details component="details-highlighter" class="mb-m">
38         <summary class="text-muted">Example Request</summary>
39         <pre><code class="language-json">{{ $endpoint['example_request'] }}</code></pre>
40     </details>
41 @endif
42
43 @if($endpoint['example_response'] ?? false)
44     <details component="details-highlighter" class="mb-m">
45         <summary class="text-muted">Example Response</summary>
46         <pre><code class="language-json">{{ $endpoint['example_response'] }}</code></pre>
47     </details>
48 @endif
49
50 @if(!$loop->last)
51     <hr>
52 @endif