redoc/lib/components/JsonSchema/json-schema.html
2016-03-18 09:06:22 -04:00

48 lines
2.2 KiB
HTML

<span *ngIf="isTrivial" class="param-wrap">
<span class="param-type param-type-trivial {{type}}"
[ngClass]="{'with-hint': _displayTypeHint}" title="{{_displayTypeHint}}">{{_displayType}}</span>
</span>
<table *ngIf="!isTrivial" class="params-wrap" [ngClass]="{'params-array': isArray}">
<template ngFor [ngForOf]="data.properties" #prop="$implicit">
<tr class="param" [ngClass]="{'discriminator': prop.isDiscriminator, 'complex': prop._pointer}">
<td class="param-name">
<span class="param-name-content">{{prop._name}}</span>
</td>
<td class="param-info">
<div>
<span class="param-type {{prop.type}}" [ngClass]="{'with-hint': prop._displayTypeHint}"
title="{{prop._displayTypeHint}}"> {{prop._displayType}} {{prop._displayFormat}}
<span class="param-range" *ngIf="prop._range"> {{prop._range}} </span>
</span>
<span *ngIf="prop.required" class="param-required">Required</span>
<div *ngIf="prop.enum" class="param-enum">
<span *ngFor="#enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
</div>
</div>
<div class="param-description" innerHtml="{{prop.description | marked}}"></div>
<div class="discriminator-info" *ngIf="prop.isDiscriminator">
This field value determines the exact schema:
<ul>
<li *ngFor="#derived of data.derived"
(click)="selectDerived(derived)" [ngClass]="{active: derived.active}"> {{derived.name}} </li>
</ul>
</div>
</td>
</tr>
<tr class="param-schema" [ngClass]="{'param-array': prop._isArray}" *ngIf="prop._pointer">
<td colspan="2">
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray' class="nested-schema">
</json-schema>
</td>
</tr>
</template>
<tr *ngIf="data.derived.length" class="param-wrap discriminator-wrap">
<td colspan="2">
<div class="derived-schema" *ngFor="#derived of data.derived" [ngClass]="{active: derived.active}">
<json-schema pointer="{{derived.$ref}}" [final]="derived.final" class="discriminator-part">
</json-schema>
</div>
</td>
</tr>
</table>