Thanks to visit codestin.com
Credit goes to github.com

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

Commit 9be57db

Browse files
Merge pull request #280 from utkarsha-deriv/utkarsha/crypto_estimations_object_error_fix
2 parents e64a60b + bb4789a commit 9be57db

File tree

1 file changed

+7
-5
lines changed
  • src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 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,15 @@ 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 (
147+
{Array.isArray(examples) ? (
148+
examples.map((el: string, i: number) => (
149149
<div key={i}>
150150
<span className={styles.schemaDefaultValue}>{el}</span>
151151
</div>
152-
);
153-
})}
152+
))
153+
) : (
154+
<span className={styles.schemaDefaultValue}>{examples}</span>
155+
)}
154156
</div>
155157
)}
156158
</div>

0 commit comments

Comments
 (0)