details.operation.ftl Maven / Gradle / Ivy
<#import "../ui.ftl" as ui/>
<#macro list coverage prefix>
<#list coverage as key, value>
${key}
${i18["details.operation.status"]}: ${value.getResponses()?keys?join(",")}
${i18["details.operation.parameters"]}
${i18["details.operation.parameter.type"]}
${i18["details.operation.parameter.name"]}
${i18["details.operation.parameter.value"]}
<#if value.getParameters()??>
<#list value.getParameters() as p>
${p.getName()}
<#if p.getExtensions()??>
<#if p.getExtensions()["x-example"]??>
<#if p.getExtensions()["x-example"]?is_boolean>
${p.getExtensions()["x-example"]?c}
<#else>
${p.getExtensions()["x-example"]}
#if>
#if>
<#elseif p.getExample()??>
<#if p.getExample()?is_boolean>
${p.getExample()?c}
<#else>
${p.getExample()}
#if>
#if>
#list>
#if>
#list>
<#if coverage?size == 0>
${i18["details.operation.no_data"]}
#if>
#macro>
<#macro details name operationResult target>
<@ui.coverageStateBadget operationResult=operationResult />
${operationResult.operationKey.path}
<#-- ${operationResult.description}-->
${operationResult.processCount} ${i18["details.operation.calls"]}
<@ui.progress
full=operationResult.allConditionCount
current=operationResult.coveredConditionCount
postfix=i18["details.conditionprogress.postfix"]
/>
<@conditionList list=operationResult.conditions />
#macro>
<#macro conditionList list>
${i18["details.conditionlist.name"]}
${i18["details.conditionlist.details"]}
<#list list as condition>
<#assign trStyle = "table-danger">
<#if condition.covered>
<#assign trStyle = "table-success">
#if>
<#if condition.covered>
<#else>
#if>
${condition.name}
${condition.reason}
#list>
#macro>