redoc/lib/components/JsonSchema/json-schema.html

56 lines
2.7 KiB
HTML
Raw Normal View History

<span *ngIf="schema.isTrivial" class="param-wrap">
<span class="param-type param-type-trivial {{schema.type}}"
[ngClass]="{'with-hint': schema._displayTypeHint}"
title="{{schema._displayTypeHint}}">{{schema._displayType}} {{schema._displayFormat}}
<span class="param-range" *ngIf="schema._range"> {{schema._range}} </span>
</span>
<div *ngIf="schema.enum" class="param-enum">
<span *ngFor="#enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
</div>
</span>
<table *ngIf="!schema.isTrivial" class="params-wrap" [ngClass]="{'params-array': schema._isArray}">
2016-04-07 20:59:59 +03:00
<!-- <caption> {{_displayType}} </caption> -->
<template ngFor [ngForOf]="schema.properties" #prop="$implicit" #last="last">
<tr class="param" [ngClass]="{'last': last, 'discriminator': prop.isDiscriminator, 'complex': prop._pointer}">
2016-03-09 01:27:19 +03:00
<td class="param-name">
<span class="param-name-content">{{prop._name}}</span>
2016-03-09 01:27:19 +03:00
</td>
<td class="param-info">
2015-11-19 00:23:18 +03:00
<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>
2016-02-04 12:49:00 +03:00
<span *ngIf="prop.required" class="param-required">Required</span>
2016-02-06 18:00:31 +03:00
<div *ngIf="prop.enum" class="param-enum">
<span *ngFor="#enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
</div>
2015-11-19 00:23:18 +03:00
</div>
<div class="param-description" innerHtml="{{prop.description | marked}}"></div>
2016-03-18 16:06:22 +03:00
<div class="discriminator-info" *ngIf="prop.isDiscriminator">
2016-04-13 14:26:59 +03:00
<span>This field value determines the exact schema:</span>
2016-03-18 16:06:22 +03:00
<ul>
<li *ngFor="#derived of schema.derived"
2016-03-18 16:06:22 +03:00
(click)="selectDerived(derived)" [ngClass]="{active: derived.active}"> {{derived.name}} </li>
</ul>
</div>
2016-03-09 01:27:19 +03:00
</td>
</tr>
<tr class="param-schema" [ngClass]="{'param-array': prop._isArray, 'last': last}" *ngIf="prop._pointer">
2016-03-09 01:27:19 +03:00
<td colspan="2">
2016-04-07 20:59:59 +03:00
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray'
class="nested-schema" [nestOdd]="!nestOdd" [attr.nesteven]="!nestOdd">
2016-01-10 18:29:35 +03:00
</json-schema>
2016-03-09 01:27:19 +03:00
</td>
</tr>
</template>
<tr *ngIf="schema.derived.length" class="param-wrap discriminator-wrap">
2016-03-09 01:27:19 +03:00
<td colspan="2">
<div class="derived-schema" *ngFor="#derived of schema.derived" [ngClass]="{active: derived.active}">
2016-04-13 14:21:56 +03:00
<json-schema [childFor]="pointer" pointer="{{derived.$ref}}" [final]="derived.final" class="discriminator-part">
2016-03-18 16:06:22 +03:00
</json-schema>
</div>
2016-03-09 01:27:19 +03:00
</td>
</tr>
</table>