File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
media/src/components/APIPage/APIDebugger Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
1
export const getCustomWidget = ( schema ) : string => {
2
- if ( schema ?. type === ' array' ) {
2
+ if ( schema ?. type === " array" ) {
3
3
// if (schema.items?.type === 'string' && schema?.widget === 'stringList') {
4
4
// return 'stringList';
5
5
// }
6
- return ' list' ;
6
+ return " list" ;
7
7
}
8
- if ( schema ?. type === ' string' ) {
8
+ if ( schema ?. type === " string" ) {
9
9
if ( schema ?. isFileTransferUrl ) {
10
- return 'fileTypeSelect' ;
10
+ return "file" ;
11
11
}
12
- if ( schema ?. format === ' binary' ) {
13
- return ' file' ;
12
+ if ( schema ?. format === " binary" ) {
13
+ return " file" ;
14
14
}
15
15
if ( schema ?. enum || schema ?. enumValueTitles ) {
16
- return ' enum' ;
16
+ return " enum" ;
17
17
}
18
- return ' string' ;
19
- } else if ( schema ?. type === ' boolean' ) {
20
- return ' booleanSwitch' ;
21
- } else if ( schema ?. type === ' object' && schema ?. additionalProperties ) {
22
- return ' map' ;
23
- } else if ( schema ?. type === ' object' && ! schema ?. properties ) {
24
- return ' json' ;
25
- } else if ( schema ?. type === ' any' ) {
26
- return ' typeSelect' ;
18
+ return " string" ;
19
+ } else if ( schema ?. type === " boolean" ) {
20
+ return " booleanSwitch" ;
21
+ } else if ( schema ?. type === " object" && schema ?. additionalProperties ) {
22
+ return " map" ;
23
+ } else if ( schema ?. type === " object" && ! schema ?. properties ) {
24
+ return " json" ;
25
+ } else if ( schema ?. type === " any" ) {
26
+ return " typeSelect" ;
27
27
} else if ( ( schema ?. ref || schema ?. $ref ) && ! schema ?. properties && ! schema ?. items ) {
28
- return ' struct' ;
28
+ return " struct" ;
29
29
}
30
30
// else if (schema?.type === 'number' || (schema?.type === 'integer' && schema?.format === 'int64')){
31
31
// return "string"
32
32
// }
33
- return '' ;
34
- } ;
33
+ return "" ;
34
+ } ;
You can’t perform that action at this time.
0 commit comments