mirror of
https://github.com/Redocly/redoc.git
synced 2025-06-05 21:43:06 +03:00
x-nullable support for non-object schemas
This commit is contained in:
parent
40c40cd327
commit
b649d52c39
|
@ -21,6 +21,7 @@
|
||||||
title="{{schema._displayTypeHint}}">{{schema._displayType}} {{schema._displayFormat}}
|
title="{{schema._displayTypeHint}}">{{schema._displayType}} {{schema._displayFormat}}
|
||||||
<span class="param-range" *ngIf="schema._range"> {{schema._range}} </span>
|
<span class="param-range" *ngIf="schema._range"> {{schema._range}} </span>
|
||||||
</span>
|
</span>
|
||||||
|
<span *ngIf="prop['x-nullable']" class="param-nullable">Nullable</span>
|
||||||
<div *ngIf="schema.enum" class="param-enum">
|
<div *ngIf="schema.enum" class="param-enum">
|
||||||
<span *ngFor="let enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
<span *ngFor="let enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,7 +71,7 @@
|
||||||
<span class="param-range" *ngIf="prop._range"> {{prop._range}} </span>
|
<span class="param-range" *ngIf="prop._range"> {{prop._range}} </span>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="prop._required" class="param-required">Required</span>
|
<span *ngIf="prop._required" class="param-required">Required</span>
|
||||||
<span *ngIf="prop._nullable" class="param-nullable">Nullable</span>
|
<span *ngIf="prop['x-nullable']" class="param-nullable">Nullable</span>
|
||||||
<div *ngIf="prop.default">Default: {{prop.default | json}}</div>
|
<div *ngIf="prop.default">Default: {{prop.default | json}}</div>
|
||||||
<div *ngIf="prop.enum && !prop.isDiscriminator" class="param-enum">
|
<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>
|
<span *ngFor="let enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||||
|
|
|
@ -163,7 +163,7 @@ const injectors = {
|
||||||
range = `[ ${propertySchema.minLength} .. ${propertySchema.maxLength} ]`;
|
range = `[ ${propertySchema.minLength} .. ${propertySchema.maxLength} ]`;
|
||||||
} else if (propertySchema.maxLength) {
|
} else if (propertySchema.maxLength) {
|
||||||
range = '<= ' + propertySchema.maxLength;
|
range = '<= ' + propertySchema.maxLength;
|
||||||
} else if (propertySchema.minimum) {
|
} else if (propertySchema.minLength) {
|
||||||
range = '>= ' + propertySchema.minLength;
|
range = '>= ' + propertySchema.minLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,6 @@ export class SchemaHelper {
|
||||||
propertySchema._pointer = null;
|
propertySchema._pointer = null;
|
||||||
}
|
}
|
||||||
propertySchema._required = !!requiredMap[propName];
|
propertySchema._required = !!requiredMap[propName];
|
||||||
propertySchema._nullable = !!propertySchema['x-nullable'];
|
|
||||||
propertySchema.isDiscriminator = (schema.discriminator === propName);
|
propertySchema.isDiscriminator = (schema.discriminator === propName);
|
||||||
return propertySchema;
|
return propertySchema;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user