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

{{ $endpoint->name() }}

@foreach($endpoint->httpMethods as $method)
{{ $method }}
@endforeach
{{ rtrim($baseUrl, '/') }}
/{{ ltrim($endpoint->uri, '/') }}
@if($endpoint->metadata->authenticated)
requires authentication
@endif
{!! Parsedown::instance()->text($endpoint->metadata->description ?: '') !!}
@if(count($endpoint->headers))

Headers

@foreach($endpoint->headers as $header => $value) @component('scribe::themes.elements.components.field-details', [ 'name' => $header, 'type' => null, 'required' => false, 'description' => null, 'example' => $value, 'endpointId' => $endpoint->endpointId(), 'component' => 'header', 'isInput' => true, ]) @endcomponent @endforeach
@endif @if(count($endpoint->urlParameters))

URL Parameters

@foreach($endpoint->urlParameters as $attribute => $parameter) @component('scribe::themes.elements.components.field-details', [ 'name' => $parameter->name, 'type' => $parameter->type ?? 'string', 'required' => $parameter->required, 'description' => $parameter->description, 'example' => $parameter->example ?? '', 'endpointId' => $endpoint->endpointId(), 'component' => 'url', 'isInput' => true, ]) @endcomponent @endforeach
@endif @if(count($endpoint->queryParameters))

Query Parameters

@foreach($endpoint->queryParameters as $attribute => $parameter) @component('scribe::themes.elements.components.field-details', [ 'name' => $parameter->name, 'type' => $parameter->type, 'required' => $parameter->required, 'description' => $parameter->description, 'example' => $parameter->example ?? '', 'endpointId' => $endpoint->endpointId(), 'component' => 'query', 'isInput' => true, ]) @endcomponent @endforeach
@endif @if(count($endpoint->nestedBodyParameters))

Body Parameters

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

Response Fields

@component('scribe::themes.elements.components.nested-fields', [ 'fields' => $endpoint->nestedResponseFields, 'endpointId' => $endpoint->endpointId(), 'isInput' => false, ]) @endcomponent
@endif
@if($metadata['try_it_out']['enabled'] ?? false) @include("scribe::themes.elements.try_it_out") @endif @if($metadata['example_languages'])
Request sample:
@foreach($metadata['example_languages'] as $index => $language)
@include("scribe::partials.example-requests.$language")
@endforeach
@endif @if($endpoint->isGet() || $endpoint->hasResponses())
Response sample:
@foreach($endpoint->responses as $index => $response)
@if(count($response->headers))
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