mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 05:40:19 +03:00
fix: dropdown if type is array
This commit is contained in:
parent
9fdcdfb049
commit
ce264112f2
|
@ -63,6 +63,10 @@ export class Schema extends React.Component<Partial<SchemaProps>> {
|
|||
return <OneOfSchema schema={schema} {...this.props} />;
|
||||
}
|
||||
|
||||
if (type && Array.isArray(type)) {
|
||||
return <ArraySchema {...(this.props as any)} />;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'object':
|
||||
if (schema.fields?.length) {
|
||||
|
|
|
@ -166,7 +166,7 @@ export class SchemaModel {
|
|||
|
||||
if (this.type === 'object') {
|
||||
this.fields = buildFields(parser, schema, this.pointer, this.options);
|
||||
} else if (this.type === 'array' && schema.items) {
|
||||
} else if ((this.type === 'array' || Array.isArray(this.type)) && schema.items) {
|
||||
this.items = new SchemaModel(parser, schema.items, this.pointer + '/items', this.options);
|
||||
this.displayType = pluralizeType(this.items.displayType);
|
||||
this.displayFormat = this.items.format;
|
||||
|
|
Loading…
Reference in New Issue
Block a user