]> BookStack Code Mirror - bookstack/blob - resources/views/api-docs/parts/endpoint.blade.php
Add optional OIDC avatar fetching from the “picture” claim
[bookstack] / resources / views / api-docs / parts / endpoint.blade.php
1 <div class="flex-container-row items-center gap-m">
2     <span class="api-method text-mono" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
3     <h5 id="{{ $endpoint['name'] }}" class="text-mono pb-xs">
4         @if($endpoint['controller_method_kebab'] === 'list')
5             <a style="color: inherit;" target="_blank" rel="noopener" href="{{ url($endpoint['uri']) }}">{{ url($endpoint['uri']) }}</a>
6         @else
7             <span>{{ url($endpoint['uri']) }}</span>
8         @endif
9     </h5>
10     <h6 class="text-uppercase text-muted text-mono ml-auto">{{ $endpoint['controller_method_kebab'] }}</h6>
11 </div>
12
13 <div class="mb-m">
14     @foreach(explode("\n", $endpoint['description'] ?? '') as $descriptionBlock)
15         <p class="mb-xxs">{{ $descriptionBlock }}</p>
16     @endforeach
17 </div>
18
19 @if($endpoint['body_params'] ?? false)
20     <details class="mb-m">
21         <summary class="text-muted">{{ $endpoint['method'] === 'GET' ? 'Query' : 'Body'  }} Parameters</summary>
22         <table class="table">
23             <tr>
24                 <th>Param Name</th>
25                 <th>Value Rules</th>
26             </tr>
27             @foreach($endpoint['body_params'] as $paramName => $rules)
28                 <tr>
29                     <td>{{ $paramName }}</td>
30                     <td>
31                         @foreach($rules as $rule)
32                             <code class="mr-xs">{{ $rule }}</code>
33                         @endforeach
34                     </td>
35                 </tr>
36             @endforeach
37         </table>
38     </details>
39 @endif
40
41 @if($endpoint['example_request'] ?? false)
42     <details component="details-highlighter" class="mb-m">
43         <summary class="text-muted">Example Request</summary>
44         <pre><code class="language-json">{{ $endpoint['example_request'] }}</code></pre>
45     </details>
46 @endif
47
48 @if($endpoint['example_response'] ?? false)
49     <details component="details-highlighter" class="mb-m">
50         <summary class="text-muted">Example Response</summary>
51         <pre><code class="language-json">{{ $endpoint['example_response'] }}</code></pre>
52     </details>
53 @endif
54
55 @if(!$loop->last)
56     <hr>
57 @endif