Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 93f40a0

Browse files
fix: production fix for examples key inside crypto_estimations
1 parent c25449a commit 93f40a0

File tree

1 file changed

+12
-8
lines changed
  • src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader

1 file changed

+12
-8
lines changed

src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type TSchemaBodyHeader = {
1010
title: string;
1111
is_open_object: boolean;
1212
setIsOpenObject: (boolean) => void;
13-
examples: string[];
13+
examples: string[] | number;
1414
enum;
1515
is_stream_types: boolean;
1616
items_type?: string;
@@ -144,13 +144,17 @@ const SchemaBodyHeader = ({
144144
{examples && (
145145
<div className={styles.defaultValue}>
146146
<span className={styles.defaultValueLabel}>example: </span>
147-
{examples.map((el: string, i: number) => {
148-
return (
149-
<div key={i}>
150-
<span className={styles.schemaDefaultValue}>{el}</span>
151-
</div>
152-
);
153-
})}
147+
{Array.isArray(examples) ? (
148+
examples.map((el: string, i: number) => {
149+
return (
150+
<div key={i}>
151+
<span className={styles.schemaDefaultValue}>{el}</span>
152+
</div>
153+
);
154+
})
155+
) : (
156+
<span className={styles.schemaDefaultValue}>{examples}</span>
157+
)}
154158
</div>
155159
)}
156160
</div>

0 commit comments

Comments
 (0)