All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.schegge.rest.markdown.macros.ftl Maven / Gradle / Ivy

<#macro EP operation endpoint>
=== <#if (endpoint.summary)??>${endpoint.summary}<#else>${operation}
<#if (endpoint.description)??>${endpoint.description}<#elseif (endpoint.summary)??>${endpoint.summary}.

<#if (endpoint.roles)??>
<#list endpoint.roles as role>
image:https://img.shields.io/badge/role-${role}-green[]



----
${operation}
----
<#if (endpoint.groupedParameters)??>

==== Parameters
<#list endpoint.groupedParameters as key, groupedParameters>

.${key}
[%header,cols="1l,1,2,1l,1l"]
|===
| Name | Required | Description | Type | Format
<#list groupedParameters as parameter>
|${parameter.name}
|<#if (parameter.required)??>${parameter.required?then('icon:check[role="red"]','')}
|<#if (parameter.description)??>${parameter.description}
<#elseif (parameter.schema.minimum)??>
must be greater than ${parameter.schema.minimum}

|${parameter.schema.typeLabel}
|${parameter.schema.format!""}

|===


<#if (endpoint.requestBody)??>

==== Request Body <#if endpoint.requestBody.required>[role="red"]^required^
[%header,cols="1l,1"]

|===
| Content-Type | Schema
<#list endpoint.requestBody.content as type, content>
| ${type}
| <#if (content.schema.schema.name)??><<${content.schema.schema.name}>>

|===



==== Responses

[%header,cols="1l,2l,2l,3"]
|===
| Code | Message | Content-Type | Schema
<#list endpoint.responses as code, response>
<#if (response.content)??>
<#list response.content as type, content>
| ${code}
| ${response.description}
| ${type}
| <#if (content.schema.schema.name)??><<${content.schema.schema.name}>>

<#else>
| ${code}
| ${response.description}
|
|


|===





© 2015 - 2024 Weber Informatics LLC | Privacy Policy