@digi-frontend/dgate-api-documentation 1.0.34 → 1.0.38
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.
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
- package/dist/src/helpers/layout.helper.js +1 -1
- package/dist/src/helpers/layout.helper.js.map +1 -1
- package/dist/styles.css +359 -359
- package/package.json +1 -1
- package/src/components/InfoForm/InfoForm.tsx +3 -1
- package/src/components/MethodAccordion/MethodAccordion.tsx +1 -2
- package/src/helpers/layout.helper.ts +13 -1
package/package.json
CHANGED
|
@@ -187,7 +187,9 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
187
187
|
{values.tags[index].externalDocs?.description && values.tags[index].externalDocs?.url && (
|
|
188
188
|
<a
|
|
189
189
|
className={styles.externalDocsLink}
|
|
190
|
-
href={values.tags[index].externalDocs?.url
|
|
190
|
+
href={values.tags[index]?.externalDocs?.url && values.tags[index]?.externalDocs?.url?.indexOf('http') > -1
|
|
191
|
+
? values.tags[index]?.externalDocs?.url
|
|
192
|
+
: `https://${values.tags[index]?.externalDocs?.url}`}
|
|
191
193
|
target="_blank"
|
|
192
194
|
style={
|
|
193
195
|
!values.tags[index].externalDocs?.description
|
|
@@ -443,7 +443,6 @@ const MethodsAccordion = ({
|
|
|
443
443
|
const currentResIndex = method.responses.findIndex(
|
|
444
444
|
(res) => res.code === currentResponse.code
|
|
445
445
|
)
|
|
446
|
-
|
|
447
446
|
if (currentResIndex !== -1) {
|
|
448
447
|
setFieldValue(
|
|
449
448
|
`responses[${currentResIndex}].content.schema.properties`,
|
|
@@ -466,7 +465,7 @@ const MethodsAccordion = ({
|
|
|
466
465
|
setFieldValue('responses', clonedResponses)
|
|
467
466
|
}
|
|
468
467
|
}}
|
|
469
|
-
onValidation={() => null}
|
|
468
|
+
onValidation={(valid) => null}
|
|
470
469
|
/>
|
|
471
470
|
}
|
|
472
471
|
/>
|
|
@@ -113,6 +113,18 @@ export const transformPathsToArray = (paths: OpenAPIFile['paths']): TransformedP
|
|
|
113
113
|
return transformedPaths
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
const validateBodyForResponse = (content, method) => {
|
|
117
|
+
let _content = JSON.parse((content?.schema as any)?.properties as string)
|
|
118
|
+
if (method == 'get') {
|
|
119
|
+
if (!_content?.body) {
|
|
120
|
+
_content = {
|
|
121
|
+
body: _content,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return _content
|
|
126
|
+
}
|
|
127
|
+
|
|
116
128
|
export const transformPathsArrayToOrigin = (paths: TransformedPathsArray): OpenAPIFile['paths'] => {
|
|
117
129
|
return paths.reduce((acc, { path, methods }) => {
|
|
118
130
|
acc[path] = methods.reduce((methodAcc, { type, tags, responses, requestBody, ...rest }) => {
|
|
@@ -128,7 +140,7 @@ export const transformPathsArrayToOrigin = (paths: TransformedPathsArray): OpenA
|
|
|
128
140
|
[content.contentType]: {
|
|
129
141
|
schema: {
|
|
130
142
|
...(content.schema as object),
|
|
131
|
-
properties:
|
|
143
|
+
properties: validateBodyForResponse(content, type),
|
|
132
144
|
},
|
|
133
145
|
},
|
|
134
146
|
}
|