@digi-frontend/dgate-api-documentation 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/src/components/InfoForm/InfoForm.js +1 -1
  2. package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
  3. package/dist/src/components/JsonInput/JsonInput.js +1 -1
  4. package/dist/src/components/JsonInput/JsonInput.js.map +1 -1
  5. package/dist/src/components/LivePreview/LivePreview.js +1 -1
  6. package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
  7. package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
  8. package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
  9. package/dist/src/components/table/table.js +1 -1
  10. package/dist/src/components/table/table.js.map +1 -1
  11. package/dist/src/components/table/tags-table.js +1 -1
  12. package/dist/src/components/table/tags-table.js.map +1 -1
  13. package/dist/src/constants/index.js.map +1 -1
  14. package/dist/src/helpers/layout.helper.js +1 -1
  15. package/dist/src/helpers/layout.helper.js.map +1 -1
  16. package/dist/src/layout/layout.js +1 -1
  17. package/dist/src/layout/layout.js.map +1 -1
  18. package/dist/src/layout/layout.module.css.js +1 -1
  19. package/dist/styles.css +341 -441
  20. package/dist/types/components/JsonInput/JsonInput.d.ts +2 -1
  21. package/dist/types/components/MethodAccordion/MethodAccordion.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/src/components/InfoForm/InfoForm.tsx +13 -7
  24. package/src/components/JsonInput/JsonInput.tsx +34 -26
  25. package/src/components/JsonInput/style.module.scss +14 -4
  26. package/src/components/LivePreview/LivePreview.tsx +142 -33
  27. package/src/components/MethodAccordion/MethodAccordion.module.scss +23 -10
  28. package/src/components/MethodAccordion/MethodAccordion.tsx +7 -4
  29. package/src/components/table/table.tsx +27 -16
  30. package/src/components/table/tags-table.tsx +1 -0
  31. package/src/constants/index.ts +4 -4
  32. package/src/helpers/layout.helper.ts +13 -1
  33. package/src/layout/layout.module.css +1 -1
  34. package/src/layout/layout.tsx +1 -2
@@ -1,4 +1,4 @@
1
- declare const JsonInput: ({ placeholder, label, value, onValidation, onChange, dataId, className, errorMessage, acceptType, fieldIsDisabled, }: {
1
+ declare const JsonInput: ({ placeholder, label, value, onValidation, onChange, dataId, className, errorMessage, acceptType, fieldIsDisabled, withFooter, }: {
2
2
  placeholder: any;
3
3
  label: any;
4
4
  value: any;
@@ -9,5 +9,6 @@ declare const JsonInput: ({ placeholder, label, value, onValidation, onChange, d
9
9
  errorMessage: any;
10
10
  acceptType?: string;
11
11
  fieldIsDisabled: any;
12
+ withFooter?: boolean;
12
13
  }) => import("react/jsx-runtime").JSX.Element;
13
14
  export default JsonInput;
@@ -2,7 +2,7 @@ import { TransformedMethod } from '../../types/layout.type';
2
2
  declare const MethodsAccordion: ({ method, path, setFieldValue, readOnly, }: {
3
3
  method: TransformedMethod;
4
4
  path: string;
5
- setFieldValue: (key: string, value: string) => void;
5
+ setFieldValue?: (key: string, value: string) => void;
6
6
  readOnly?: boolean;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default MethodsAccordion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -11,10 +11,13 @@ import SVGLoader from '../../components/SVGLoader/SVGLoader'
11
11
  import CommonDialog from '../../components/dialog'
12
12
  import { tagsTableHeaders } from '../../constants/index'
13
13
  import TagsTable from '../../components/table/tags-table'
14
+
14
15
  const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
15
16
  const [tableData, setTableData] = useState([])
16
17
  const [tableRecords, setTableRecords] = useState()
17
18
  const [authType, setAuthType] = useState('')
19
+ const [description, setDescription] = useState('')
20
+ const [url, setURL] = useState('')
18
21
  const { values, setFieldValue, errors } = useFormikContext<TransformedOpenApi>()
19
22
  const [externalTooltipRefs, setExternalTooltipRefs] = useState<{ [key: number]: any }>({})
20
23
  const [tooltipRefs, setTooltipRefs] = useState<{ [key: number]: any }>({})
@@ -162,22 +165,24 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
162
165
  placeholder="Describe External Doc..."
163
166
  value={item.externalDocs?.description}
164
167
  disabled={readOnly}
165
- onChange={(value) =>
168
+ onChange={(value) => {
166
169
  onTableChange(
167
170
  'externalDocs',
168
171
  { ...item.externalDocs, description: value },
169
172
  index
170
173
  )
171
- }
174
+ setDescription(value)
175
+ }}
172
176
  />
173
177
  <p className={styles.editDescTooltipContent_header}>External Docs Link</p>
174
178
  <TextArea
175
179
  placeholder="External Docs Link..."
176
180
  value={item.externalDocs?.url}
177
181
  disabled={readOnly}
178
- onChange={(value) =>
182
+ onChange={(value) => {
179
183
  onTableChange('externalDocs', { ...item.externalDocs, url: value }, index)
180
- }
184
+ setURL(value)
185
+ }}
181
186
  />
182
187
  {!readOnly && (
183
188
  <Button
@@ -186,10 +191,11 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
186
191
  size="small"
187
192
  onClick={() => {
188
193
  setFieldValue(`tags[${index}].externalDocs`, {
189
- description: item.externalDocDesc,
190
- url: item.externalDocLink,
194
+ description: description,
195
+ url: url,
191
196
  })
192
- console.log({ tags: values.tags })
197
+ setDescription('')
198
+ setURL('')
193
199
  externalTooltipRefs[index]?.hide()
194
200
  }}
195
201
  >
@@ -13,6 +13,7 @@ const JsonInput = ({
13
13
  errorMessage,
14
14
  acceptType = 'BOTH',
15
15
  fieldIsDisabled,
16
+ withFooter = true,
16
17
  }) => {
17
18
  const [isValid, setIsValid] = useState()
18
19
  const [disabledBeautify, setDisabledBeautify] = useState(true)
@@ -69,7 +70,11 @@ const JsonInput = ({
69
70
  }, [])
70
71
 
71
72
  return (
72
- <div className={`${styles['json-editor-container']} ${className}`}>
73
+ <div
74
+ className={`${styles['json-editor-container']} ${className} ${
75
+ fieldIsDisabled ? styles.disabled : ''
76
+ }`}
77
+ >
73
78
  {label && <p className={`${styles['json-editor-label']}`}>{label}</p>}
74
79
  <div
75
80
  className={`${styles['json-editor']} ${
@@ -77,6 +82,7 @@ const JsonInput = ({
77
82
  }`}
78
83
  >
79
84
  <textarea
85
+ disabled={fieldIsDisabled}
80
86
  data-id={dataId}
81
87
  value={value}
82
88
  onChange={(e) => {
@@ -94,31 +100,33 @@ const JsonInput = ({
94
100
  min="1"
95
101
  placeholder={placeholder}
96
102
  />
97
- <div className={`${styles['actions-container']}`}>
98
- <button
99
- type="button"
100
- className={styles.validate}
101
- onClick={() => {
102
- const valid = checkIsValid()
103
- setIsValid(valid)
104
- onValidation(valid)
105
- setDisabledBeautify(!checkIsValid())
106
- }}
107
- data-id={`${dataId}-VALIDATE-BUTTON`}
108
- disabled={value === ''}
109
- >
110
- Validate
111
- </button>
112
- <button
113
- type="button"
114
- disabled={value === '' || disabledBeautify}
115
- data-id={`${dataId}-BEAUTIFY-BUTTON`}
116
- className={styles.beautify}
117
- onClick={handlePrettify}
118
- >
119
- Beautify
120
- </button>
121
- </div>
103
+ {withFooter && (
104
+ <div className={`${styles['actions-container']}`}>
105
+ <button
106
+ type="button"
107
+ className={styles.validate}
108
+ onClick={() => {
109
+ const valid = checkIsValid()
110
+ setIsValid(valid)
111
+ onValidation(valid)
112
+ setDisabledBeautify(!checkIsValid())
113
+ }}
114
+ data-id={`${dataId}-VALIDATE-BUTTON`}
115
+ disabled={value === ''}
116
+ >
117
+ Validate
118
+ </button>
119
+ <button
120
+ type="button"
121
+ disabled={value === '' || disabledBeautify}
122
+ data-id={`${dataId}-BEAUTIFY-BUTTON`}
123
+ className={styles.beautify}
124
+ onClick={handlePrettify}
125
+ >
126
+ Beautify
127
+ </button>
128
+ </div>
129
+ )}
122
130
  </div>
123
131
  {(errorMessage || (value !== '' && isValid === false)) && (
124
132
  <p className={styles['error-message']}>{errorMessage || 'Invalid JSON or YAML format'}</p>
@@ -1,4 +1,8 @@
1
1
  .json-editor-container {
2
+ overflow: hidden;
3
+ border-bottom-right-radius: 0.3125rem;
4
+ border-bottom-left-radius: 0.3125rem;
5
+
2
6
  .json-editor-label {
3
7
  font-size: 0.875rem;
4
8
  font-weight: 600;
@@ -11,10 +15,9 @@
11
15
  flex-direction: column;
12
16
  background-color: #142452;
13
17
  width: 100%;
14
- border-radius: 0.3125rem;
15
- margin-bottom: -0.5rem;
16
18
  outline: 1px solid transparent;
17
19
  position: relative;
20
+ overflow: hidden;
18
21
 
19
22
  .actions-container {
20
23
  width: 100%;
@@ -80,7 +83,6 @@
80
83
  background-color: #142452;
81
84
  border: none;
82
85
  resize: none;
83
- border-radius: 0.3125rem;
84
86
 
85
87
  &:focus,
86
88
  &:focus-within,
@@ -97,7 +99,6 @@
97
99
  background-color: #828699;
98
100
  border: none;
99
101
  border-color: transparent;
100
- border-top-right-radius: 0.25rem;
101
102
  border-top-left-radius: 0;
102
103
  }
103
104
 
@@ -120,4 +121,13 @@
120
121
  line-height: 1.25rem;
121
122
  margin-top: 0.625rem;
122
123
  }
124
+
125
+ &.disabled {
126
+ .json-editor {
127
+ textarea {
128
+ background-color: white;
129
+ color: #12131a;
130
+ }
131
+ }
132
+ }
123
133
  }
@@ -1,23 +1,144 @@
1
- import React from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import styles from './LivePreview.module.scss'
3
3
  import SimpleLabelValue from '../../components/SimpleLabelValue'
4
- import Chips from '../../components/Chips/Chips'
4
+
5
5
  import MethodsAccordion from '../../components/MethodAccordion/MethodAccordion'
6
6
  import { TransformedOpenApi } from '../../types/transformedOpenApi'
7
7
  import { useFormikContext } from 'formik'
8
+ import { methodColorMapping, tagsTableHeaders } from '../../constants/index'
9
+ import TagsTable from '../table/tags-table'
10
+ import { Button, TextArea } from 'digitinary-ui'
11
+ import Tooltip from '../../components/Tooltip/Tooltip'
12
+ import { DeleteIcon, deleteOutlinedIcon, EditIcon } from '../../assets/icons'
8
13
 
9
14
  interface LivePreviewProps {
10
15
  transformedData?: TransformedOpenApi
11
16
  }
12
17
 
13
18
  const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
14
- const { values, setFieldValue } = useFormikContext<TransformedOpenApi>()
15
- const { info, components, tags, paths } = values
19
+ const [tableRecords, setTableRecords] = useState()
20
+ const [tooltipRefs, setTooltipRefs] = useState<{ [key: number]: any }>({})
21
+ const [tableData, setTableData] = useState([])
22
+ const [externalTooltipRefs, setExternalTooltipRefs] = useState<{ [key: number]: any }>({})
23
+ const { values } = useFormikContext<TransformedOpenApi>()
24
+ const { info, components, tags } = values
16
25
  const { securitySchemes } = components
17
26
  const securityKey =
18
27
  securitySchemes && typeof securitySchemes == 'object' && Object.keys(securitySchemes).length
19
28
  ? Object.keys(securitySchemes)[0]
20
29
  : null
30
+
31
+ useEffect(() => {
32
+ console.log({updated: values.tags})
33
+ if (values.tags && values.tags.length) {
34
+ setTableRecords(generateTableData(values.tags, true))
35
+ setTableData(values.tags)
36
+ }
37
+ }, [values.tags])
38
+
39
+ const generateTableData = (items, readOnly) => {
40
+ return items.map((item, index) => ({
41
+ id: index,
42
+ tagName: item.name,
43
+ description: (
44
+ <div className={styles.paramDescContainer}>
45
+ <Tooltip
46
+ arrowWithBorder
47
+ placement="bottom-end"
48
+ type="function"
49
+ trigger="click"
50
+ delay={[0, 0]}
51
+ onCreate={(instance) =>
52
+ setTooltipRefs((prev) => ({
53
+ ...prev,
54
+ [index]: instance,
55
+ }))
56
+ }
57
+ content={
58
+ <div className={styles.editDescTooltipContent}>
59
+ <p className={styles.editDescTooltipContent_header}>Description</p>
60
+ <TextArea
61
+ placeholder="Describe parameter..."
62
+ value={item.description}
63
+ disabled={readOnly}
64
+ onChange={(value) => null}
65
+ />
66
+ </div>
67
+ }
68
+ >
69
+ <Button className={styles.editDescBtn} variant="link" color="action">
70
+ {item.description ? item.description.substring(0, 12) : '-'}
71
+ {item.description && item.description.length > 12 ? '...' : ''}
72
+ </Button>
73
+ </Tooltip>
74
+ </div>
75
+ ),
76
+ externalDocs: (
77
+ <div className={styles.paramDescContainer}>
78
+ <Tooltip
79
+ arrowWithBorder
80
+ placement="bottom-end"
81
+ type="function"
82
+ trigger="click"
83
+ delay={[0, 0]}
84
+ onCreate={(instance) =>
85
+ setExternalTooltipRefs((prev) => ({
86
+ ...prev,
87
+ [index]: instance,
88
+ }))
89
+ }
90
+ content={
91
+ <div className={styles.editDescTooltipContent}>
92
+ <p className={styles.editDescTooltipContent_header}>External Docs Description</p>
93
+ <TextArea
94
+ placeholder="Describe External Doc..."
95
+ value={item.externalDocs?.description}
96
+ disabled={readOnly}
97
+ onChange={(value) => null}
98
+ />
99
+ <p className={styles.editDescTooltipContent_header}>External Docs Link</p>
100
+ <TextArea
101
+ placeholder="External Docs Link..."
102
+ value={item.externalDocs?.url}
103
+ disabled={readOnly}
104
+ onChange={(value) => null}
105
+ />
106
+ </div>
107
+ }
108
+ >
109
+ <Button
110
+ className={styles.editDescBtn}
111
+ variant="link"
112
+ color="action"
113
+ onClick={() => {
114
+ const a = document.createElement('a')
115
+ a.href = item.externalDocs?.url
116
+ a.click()
117
+ }}
118
+ >
119
+ {item?.externalDocs?.description
120
+ ? item?.externalDocs?.description?.substring(0, 12)
121
+ : '-'}
122
+ {item?.externalDocs?.description && item?.externalDocs?.description?.length > 12
123
+ ? '...'
124
+ : ''}
125
+ </Button>
126
+ </Tooltip>
127
+
128
+ {!readOnly && <div className={styles.paramDescContainer_separator}></div>}
129
+
130
+ {!readOnly && (
131
+ <Button
132
+ className={styles.deleteParamBtn}
133
+ variant="link"
134
+ color="error"
135
+ onClick={() => null}
136
+ ></Button>
137
+ )}
138
+ </div>
139
+ ),
140
+ }))
141
+ }
21
142
  return (
22
143
  <div>
23
144
  <div className="row">
@@ -38,38 +159,26 @@ const LivePreview: React.FC<LivePreviewProps> = ({ transformedData }) => {
38
159
  <SimpleLabelValue
39
160
  key={'tags'}
40
161
  label={'Tags: '}
41
- value={
42
- tags && tags.length ? (
43
- <Chips
44
- className={styles.tagsChips}
45
- items={tags.map((t) => ({
46
- id: t.name,
47
- label: t.name,
48
- disabled: true,
49
- }))}
50
- />
51
- ) : (
52
- '-'
53
- )
54
- }
162
+ />
163
+ <TagsTable
164
+ id="tags-table"
165
+ data={tableRecords}
166
+ headCells={tagsTableHeaders}
167
+ isFormOpen={false}
168
+ setIsFormOpen={() => null}
169
+ saveNewRow={() => null}
170
+ readOnly={true}
55
171
  />
56
172
 
57
173
  <SimpleLabelValue key={'endpoints'} label={'Endpoints '} />
58
- {values.paths.map((path, pathIndex) => (
59
- <>
60
- {path.methods.map((method, methodIndex) => (
61
- <MethodsAccordion
62
- readOnly
63
- method={method}
64
- path={path.path}
65
- setFieldValue={(key, value) => {
66
- const h = `paths[${pathIndex}].methods[${methodIndex}].${key}`
67
- setFieldValue(h, value)
68
- }}
69
- handleSave={()=>null}
70
- />
71
- ))}
72
- </>
174
+ {values.paths.map((path) => (
175
+ <div className={styles.methodsContainer}>
176
+ {path.methods
177
+ .sort((a, b) => methodColorMapping[a.type].order + methodColorMapping[b.type].order)
178
+ .map((method, methodIndex) => (
179
+ <MethodsAccordion readOnly method={method} path={path.path} />
180
+ ))}
181
+ </div>
73
182
  ))}
74
183
  </div>
75
184
  </div>
@@ -71,16 +71,6 @@
71
71
  transition: rotate 0.3s ease-in-out;
72
72
  }
73
73
  }
74
-
75
- &.readOnly {
76
- .methodSummary {
77
- background-color: #ebecf2;
78
- }
79
-
80
- .methodExpandArrowContainer {
81
- background-color: #ebecf2;
82
- }
83
- }
84
74
  }
85
75
 
86
76
  .methodAccordionContent {
@@ -309,4 +299,27 @@
309
299
  }
310
300
  }
311
301
  }
302
+
303
+ &.readOnly {
304
+ .methodAccordionContent {
305
+ padding: 0;
306
+ }
307
+ :global(.accordion-header) {
308
+ margin: 1.25rem 0 0 0 !important;
309
+ }
310
+
311
+ :global(.accordion-details) {
312
+ background-color: transparent !important;
313
+ }
314
+
315
+ .methodSummaryContainer {
316
+ .methodSummary {
317
+ background-color: #ebecf2;
318
+ }
319
+
320
+ .methodExpandArrowContainer {
321
+ background-color: #ebecf2;
322
+ }
323
+ }
324
+ }
312
325
  }
@@ -39,7 +39,7 @@ const MethodsAccordion = ({
39
39
  }: {
40
40
  method: TransformedMethod
41
41
  path: string
42
- setFieldValue: (key: string, value: string) => void
42
+ setFieldValue?: (key: string, value: string) => void
43
43
  readOnly?: boolean
44
44
  }) => {
45
45
  const [isExpanded, setIsExpanded] = useState({
@@ -218,9 +218,9 @@ const MethodsAccordion = ({
218
218
  <Accordion
219
219
  expanded={isExpanded.method}
220
220
  onChange={() => setIsExpanded((prev) => ({ ...prev, method: !prev.method }))}
221
- className={styles.methodAccordion}
221
+ className={`${styles.methodAccordion} ${readOnly ? styles.readOnly : ''}`}
222
222
  summary={
223
- <div className={`${styles.methodSummaryContainer} ${readOnly ? styles.readOnly : ''}`}>
223
+ <div className={styles.methodSummaryContainer}>
224
224
  <div className={styles.methodSummary}>
225
225
  <span
226
226
  style={{
@@ -247,7 +247,7 @@ const MethodsAccordion = ({
247
247
  <TextArea
248
248
  className={styles.methodDesc}
249
249
  label="Description"
250
- placeholder="Describe the endpoint's purpose and functionality..."
250
+ placeholder="Describe the method's purpose and functionality..."
251
251
  value={method?.description}
252
252
  onChange={(value) => setFieldValue('description', value)}
253
253
  />
@@ -299,6 +299,7 @@ const MethodsAccordion = ({
299
299
  }
300
300
  children={
301
301
  <JsonInput
302
+ withFooter={!readOnly}
302
303
  className={'jsonField'}
303
304
  placeholder="Enter your request body as a JSON object...."
304
305
  fieldIsDisabled={readOnly}
@@ -340,6 +341,7 @@ const MethodsAccordion = ({
340
341
  withSearch={false}
341
342
  isMultiple={false}
342
343
  clearable={false}
344
+ disabled={readOnly}
343
345
  placeholder="200"
344
346
  options={[
345
347
  {
@@ -355,6 +357,7 @@ const MethodsAccordion = ({
355
357
  }
356
358
  children={
357
359
  <JsonInput
360
+ withFooter={!readOnly}
358
361
  className={'jsonField'}
359
362
  placeholder="Enter your response as a JSON object..."
360
363
  fieldIsDisabled={readOnly}
@@ -46,6 +46,7 @@ const ParamterTable = ({
46
46
  resetForm()
47
47
  },
48
48
  })
49
+
49
50
  return (
50
51
  <div className="tableSectionContainer">
51
52
  <div className="tableContainer">
@@ -105,12 +106,22 @@ const ParamterTable = ({
105
106
  </tr>
106
107
  )
107
108
  })}
108
- {isFormOpen ? (
109
- <tr key={''} data-i={''} className={`row`}>
109
+ {data?.length === 0 && readOnly && (
110
+ <tr className="fallbackTableRow">
111
+ <td className="fallbackContainer" colSpan={headCells?.length}>
112
+ <div className="fallbackTextContainer">
113
+ <span className="fallbackText"> No Data Available</span>
114
+ </div>
115
+ </td>
116
+ </tr>
117
+ )}
118
+
119
+ {isFormOpen && !readOnly ? (
120
+ <tr className={`row`}>
110
121
  <td key={'Parameter name'}>
111
122
  <div data-id="TEXT_DESCRIPTION" className="tableData">
112
123
  <Input
113
- placeholder="paramter name"
124
+ placeholder="Parameter name"
114
125
  size="large"
115
126
  type="text"
116
127
  // errorMsg={!!errors.name && errors.name}
@@ -154,6 +165,7 @@ const ParamterTable = ({
154
165
  <div data-id="TEXT_DESCRIPTION" className="tableData">
155
166
  <SelectGroupV2
156
167
  disabled={readOnly}
168
+ clearable={false}
157
169
  value={{
158
170
  label: capitalize(values.schema.type),
159
171
  value: capitalize(values.schema.type),
@@ -180,20 +192,19 @@ const ParamterTable = ({
180
192
 
181
193
  <td key={'parameter required'}>
182
194
  <div data-id="is required" className="tableData">
183
- {
184
- readOnly ?
185
- <>{values.required ? 'True': 'False'}</>
186
- :
195
+ {readOnly ? (
196
+ <>{values.required ? 'True' : 'False'}</>
197
+ ) : (
187
198
  <Switch
188
- checked={values.required}
189
- onClick={() => {
190
- if (readOnly) {
191
- return
192
- }
193
- setFieldValue('required', !values.required)
194
- }}
195
- />
196
- }
199
+ checked={values.required}
200
+ onClick={() => {
201
+ if (readOnly) {
202
+ return
203
+ }
204
+ setFieldValue('required', !values.required)
205
+ }}
206
+ />
207
+ )}
197
208
  </div>
198
209
  </td>
199
210
 
@@ -223,6 +223,7 @@ const TagsTable = ({ id, headCells, data, isFormOpen, setIsFormOpen, saveNewRow,
223
223
  onClick={() => {
224
224
  const a = document.createElement('a')
225
225
  a.href = values.externalDocs?.url
226
+ a.target = '_blank'
226
227
  a.click()
227
228
  }}
228
229
  >
@@ -46,20 +46,20 @@ export const tagsTableHeaders = [
46
46
  id: 'tagName',
47
47
  label: 'Tag Name',
48
48
  sortable: false,
49
- classes:'requiredParam'
49
+ classes: 'requiredParam',
50
50
  },
51
51
  {
52
52
  id: 'description',
53
53
  label: 'Description',
54
54
  sortable: false,
55
- classes:'requiredParam'
55
+ classes: 'requiredParam',
56
56
  },
57
57
  {
58
58
  id: 'externalDocs',
59
59
  label: 'External Docs',
60
60
  sortable: false,
61
- classes:'requiredParam'
62
- }
61
+ classes: 'requiredParam',
62
+ },
63
63
  ]
64
64
 
65
65
  export const paramsTableHeaders = [
@@ -5,13 +5,21 @@ import { TransformedOpenApi } from '@entities/transformedOpenApi'
5
5
  export const transformOpenApiObject = (openApiJson: OpenAPIFile): TransformedOpenApi => {
6
6
  if (openApiJson.components && openApiJson.components.securitySchemes) {
7
7
  const authKey = Object.keys(openApiJson.components.securitySchemes)?.at(0)
8
-
9
8
  if (authKey) {
10
9
  openApiJson.components.securitySchemes[authKey].type =
11
10
  openApiJson?.components?.securitySchemes?.[
12
11
  authKey
13
12
  ]?.type?.toUpperCase() as SecurityScheme['type']
14
13
  }
14
+ } else {
15
+ openApiJson.components = {
16
+ securitySchemes: {
17
+ Public: {
18
+ type: 'http',
19
+ scheme: 'public',
20
+ },
21
+ },
22
+ }
15
23
  }
16
24
 
17
25
  return {
@@ -63,6 +71,10 @@ export const transformPathsToArray = (paths: OpenAPIFile['paths']): TransformedP
63
71
  }
64
72
  }),
65
73
  }
74
+ // Add parameters if it does not exist in the original JSON
75
+ if (!methodProps?.parameters) {
76
+ obj.parameters = []
77
+ }
66
78
 
67
79
  if (method.toLowerCase() != 'get') {
68
80
  const contentType = Object.keys(methodProps?.requestBody?.content || {})[0]