{#if swagger} {swagger.info.title} {:else} Swagger UI using Svelte {/if}
{#if swagger}

{swagger.info.title}

{swagger.info.description} - {swagger.info.version}

{#if swagger.info.contact}
{swagger.info.contact.name} - {swagger.info.contact.email}
{/if}
{#each Object.entries(paths) as category, routeIdx}

{ category[0] }

{#each category[1] as method, methodIdx}
{method.method}
{method.route}
{#if method.summary}
{ method.summary }
{/if}
{#if method.requestBody && method.requestBody.content} {#each Object.entries(method.requestBody.content) as requestBody }

Request Body - {requestBody[0]}

{#if '$ref' in requestBody[1]["schema"]} {#each Object.entries(getSchema(requestBody[1]["schema"]["$ref"]).properties) as property} {/each} {:else} {#each Object.entries(requestBody[1]["schema"]["properties"]) as property} {/each} {/if}
Name Description Type
{ property[0] } {@html property[1].description } {#if property[1].type} { property[1].type} {:else} String {/if}
{ property[0] } {@html property[1].description } {#if property[1].type} { property[1].type} {:else} String {/if}

{#if '$ref' in requestBody[1]["schema"]}
{/if}
{/each} {/if} {#if method.parameters && method.parameters.length > 0}

Parameters

{#each method.parameters as parameter} {/each}
Name Input Description Located in Type
{#if parameter.required} { parameter.name } {:else} { parameter.name } {/if} {@html parameter.description } {parameter.in } {#if parameter.type} { parameter.type} {#if parameter.items } of { parameter.items.type } {/if} {:else} String {/if}
{/if} {#if responses[method['id']] }

Url: {responses[method['id']].url}

Result

{responses[method['id']].status}

{responses[method['id']].statusText}

Headers:


                        {[...responses[method['id']].headers.entries()].map(x => x.join(": ")).join(" \n")}
                          
{#if Object.keys(responses[method['id']].body).length === 0 && responses[method['id']].body.constructor === Object}

Body:

{JSON.stringify(responses[method['id']].json(), null, 2)} {/if}
{/if} {#if method.responses}

Responses

{#each Object.entries(method.responses) as response}
{#each Object.entries(response[1].content) as content}
{response[0]}

{ response[1].description }

Content-type: {content[0]} {#if '$ref' in content[1].schema}
    Example:
    
                                    {JSON.stringify(getSchema(content[1].schema["$ref"]).example, null, 2)}
                                        
    {#each Object.entries(getSchema(content[1].schema["$ref"]).properties) as property} {/each}
{/if}
{/each}
{/each}
{/if}

{/each}
{/each} {/if}