@php /** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */ @endphp

{{ $endpoint->metadata->title ?: ($endpoint->httpMethods[0]." ".$endpoint->uri)}}

@component('scribe::components.badges.auth', ['authenticated' => $endpoint->metadata->authenticated]) @endcomponent

{!! Parsedown::instance()->text($endpoint->metadata->description ?: '') !!}
Example request:
@foreach($metadata['example_languages'] as $language)
@include("scribe::partials.example-requests.$language")
@endforeach
@if($endpoint->isGet() || $endpoint->hasResponses()) @foreach($endpoint->responses as $response)

Example response ({{$response->description ?: $response->status}}):

@if(count($response->headers))
Show headers
@foreach($response->headers as $header => $value)
{{ $header }}: {{ is_array($value) ? implode('; ', $value) : $value }}
@endforeach 
@endif
@if(is_string($response->content) && Str::startsWith($response->content, "<>"))
[Binary data] - {{ htmlentities(str_replace("<>", "", $response->content)) }}
@elseif($response->status == 204)
[Empty response]
@else
@php($parsed = json_decode($response->content))
{{-- If response is a JSON string, prettify it. Otherwise, just print it --}}
{!! htmlentities($parsed != null ? json_encode($parsed, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : $response->content) !!}
@endif 
@endforeach @endif

Request    @if($metadata['try_it_out']['enabled'] ?? false)    @endif

@foreach($endpoint->httpMethods as $method)

@component('scribe::components.badges.http-method', ['method' => $method])@endcomponent {{$endpoint->uri}}

@endforeach @if($endpoint->metadata->authenticated && $metadata['auth']['location'] === 'header')

@endif @if(count($endpoint->urlParameters))

URL Parameters

@foreach($endpoint->urlParameters as $attribute => $parameter)

@component('scribe::components.field-details', [ 'name' => $parameter->name, 'type' => $parameter->type ?? 'string', 'required' => $parameter->required, 'description' => $parameter->description, 'example' => $parameter->example ?? '', 'endpointId' => $endpoint->endpointId(), 'component' => 'url', ]) @endcomponent

@endforeach @endif @if(count($endpoint->queryParameters))

Query Parameters

@foreach($endpoint->queryParameters as $attribute => $parameter)

@component('scribe::components.field-details', [ 'name' => $parameter->name, 'type' => $parameter->type, 'required' => $parameter->required, 'description' => $parameter->description, 'example' => $parameter->example ?? '', 'endpointId' => $endpoint->endpointId(), 'component' => 'query', ]) @endcomponent

@endforeach @endif @if(count($endpoint->nestedBodyParameters))

Body Parameters

@component('scribe::components.body-parameters', ['parameters' => $endpoint->nestedBodyParameters, 'endpointId' => $endpoint->endpointId(),]) @endcomponent @endif
@if(count($endpoint->responseFields))

Response

Response Fields

@foreach($endpoint->responseFields as $name => $field)

@component('scribe::components.field-details', [ 'name' => $field->name, 'type' => $field->type, 'required' => true, 'description' => $field->description, 'isInput' => false, ]) @endcomponent

@endforeach @endif