Skip to content

Commit 84ca1b1

Browse files
committed
fix: displaying nested items with type string
1 parent 639fd2c commit 84ca1b1

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/components/Fields/ArrayItemDetails.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ export function ArrayItemDetails({ schema }: { schema: SchemaModel }) {
1818
return null;
1919
}
2020

21-
if (schema.type === 'string' && schema.pattern) {
22-
return (
23-
<Wrapper>
24-
[<Pattern schema={schema} />]
25-
</Wrapper>
26-
);
27-
}
28-
2921
return (
3022
<Wrapper>
3123
[ items

src/components/Fields/FieldDetails.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TypePrefix,
99
TypeTitle,
1010
} from '../../common-elements/fields';
11-
import { getSerializedValue, isObject } from '../../utils';
11+
import { getSerializedValue, isArray, isObject } from '../../utils';
1212
import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation';
1313
import { Markdown } from '../Markdown/Markdown';
1414
import { EnumValues } from './EnumValues';
@@ -30,7 +30,8 @@ export const FieldDetailsComponent = observer((props: FieldProps) => {
3030

3131
const { showExamples, field, renderDiscriminatorSwitch } = props;
3232
const { schema, description, deprecated, extensions, in: _in, const: _const } = field;
33-
const isArrayType = schema.type === 'array';
33+
const isArrayType =
34+
schema.type === 'array' || (isArray(schema.type) && schema.type.includes('array'));
3435

3536
const rawDefault = enumSkipQuotes || _in === 'header'; // having quotes around header field default values is confusing and inappropriate
3637

0 commit comments

Comments
 (0)