mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
support "x-nullable" property
This commit is contained in:
parent
22eff033e3
commit
027cdc19c8
|
@ -819,6 +819,7 @@ definitions:
|
|||
type: string
|
||||
pattern: "^\\+(?:[0-9]-?){6,14}[0-9]$"
|
||||
example: +1-202-555-0192
|
||||
x-nullable: true
|
||||
userStatus:
|
||||
description: User status
|
||||
type: integer
|
||||
|
|
|
@ -63,6 +63,14 @@ $sub-schema-offset: ($bullet-size / 2) + $bullet-margin;
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.param-nullable {
|
||||
vertical-align: middle;
|
||||
line-height: $param-name-height;
|
||||
color: #3195a6;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.param-type {
|
||||
vertical-align: middle;
|
||||
line-height: $param-name-height;
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
<span class="param-range" *ngIf="prop._range"> {{prop._range}} </span>
|
||||
</span>
|
||||
<span *ngIf="prop._required" class="param-required">Required</span>
|
||||
<span *ngIf="prop._nullable" class="param-nullable">Nullable</span>
|
||||
<div *ngIf="prop.default">Default: {{prop.default | json}}</div>
|
||||
<div *ngIf="prop.enum && !prop.isDiscriminator" class="param-enum">
|
||||
<span *ngFor="let enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
|
|
|
@ -229,6 +229,7 @@ export class SchemaHelper {
|
|||
propertySchema._pointer = null;
|
||||
}
|
||||
propertySchema._required = !!requiredMap[propName];
|
||||
propertySchema._nullable = !!propertySchema['x-nullable'];
|
||||
propertySchema.isDiscriminator = (schema.discriminator === propName);
|
||||
return propertySchema;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user