diff --git a/src/components/Fields/ArrayItemDetails.tsx b/src/components/Fields/ArrayItemDetails.tsx index bbae1991..b45f56a8 100644 --- a/src/components/Fields/ArrayItemDetails.tsx +++ b/src/components/Fields/ArrayItemDetails.tsx @@ -18,14 +18,6 @@ export function ArrayItemDetails({ schema }: { schema: SchemaModel }) { return null; } - if (schema.type === 'string' && schema.pattern) { - return ( - - [] - - ); - } - return ( [ items diff --git a/src/components/Fields/FieldDetails.tsx b/src/components/Fields/FieldDetails.tsx index 40c1122f..570c382f 100644 --- a/src/components/Fields/FieldDetails.tsx +++ b/src/components/Fields/FieldDetails.tsx @@ -8,7 +8,7 @@ import { TypePrefix, TypeTitle, } from '../../common-elements/fields'; -import { getSerializedValue, isObject } from '../../utils'; +import { getSerializedValue, isArray, isObject } from '../../utils'; import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation'; import { Markdown } from '../Markdown/Markdown'; import { EnumValues } from './EnumValues'; @@ -30,7 +30,8 @@ export const FieldDetailsComponent = observer((props: FieldProps) => { const { showExamples, field, renderDiscriminatorSwitch } = props; const { schema, description, deprecated, extensions, in: _in, const: _const } = field; - const isArrayType = schema.type === 'array'; + const isArrayType = + schema.type === 'array' || (isArray(schema.type) && schema.type.includes('array')); const rawDefault = enumSkipQuotes || _in === 'header'; // having quotes around header field default values is confusing and inappropriate