diff --git a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java index 949f08c8a1..2a00708dda 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java @@ -384,7 +384,12 @@ public class ShareInfoService extends BaseShareInfoService { } else { apiInfoDTO.setResponseBodyParamType(type); } - if (StringUtils.equalsAny(type, "JSON", "XML", "Raw")) { + if (StringUtils.equalsIgnoreCase(type, "Raw")) { + if (bodyObj.has("raw")) { + String raw = bodyObj.get("raw").asText(); + apiInfoDTO.setResponseBodyStructureData(raw); + } + } else if (StringUtils.equalsAny(type, "JSON", "XML")) { //判断是否是JsonSchema boolean isJsonSchema = false; diff --git a/api-test/frontend/src/business/definition/components/document/components/ApiInformation.vue b/api-test/frontend/src/business/definition/components/document/components/ApiInformation.vue index d5eb3edfea..5009e093ba 100644 --- a/api-test/frontend/src/business/definition/components/document/components/ApiInformation.vue +++ b/api-test/frontend/src/business/definition/components/document/components/ApiInformation.vue @@ -4,7 +4,7 @@

{{ shareUrl }}

- {{ $t('commons.copy') }} + {{ $t('commons.copy') }}
@@ -36,7 +36,7 @@ {{ $t('api_test.definition.request.responsible') }} : {{ apiInfo.responsibler }} {{ $t('commons.create_user') }} : {{ apiInfo.createUser }} - {{ $t('commons.description') }} : {{ apiInfo.desc }} + {{ $t('commons.description') }} : {{ apiInfo.desc }} @@ -102,7 +102,7 @@ import MsCodeEdit from 'metersphere-frontend/src/components/MsCodeEdit'; import ApiStatus from '@/business/definition/components/list/ApiStatus'; import MsJsonCodeEdit from '@/business/commons/json-schema/JsonSchemaEditor'; import ApiRemarkShow from '@/business/definition/components/document/components/ApiRemarkShow'; -import { generateApiDocumentShareInfo, documentShareUrl } from '@/api/share'; +import { documentShareUrl, generateApiDocumentShareInfo } from '@/api/share'; import ApiInfoCollapse from '@/business/definition/components/document/components/ApiInfoCollapse'; import ApiRequestInfo from '@/business/definition/components/document/components/ApiRequestInfo'; import ApiResponseInfo from '@/business/definition/components/document/components/ApiResponseInfo'; @@ -210,7 +210,9 @@ export default { hasResponseBody(apiInfo) { let hasParams = false; if (apiInfo) { - if (this.formParamTypes.includes(apiInfo.responseBodyParamType)) { + if (apiInfo.responseBodyParamType === 'Raw') { + hasParams = true; + } else if (this.formParamTypes.includes(apiInfo.responseBodyParamType)) { if (apiInfo.responseBodyFormData && apiInfo.responseBodyFormData !== '无') { let jsonArr = JSON.parse(apiInfo.responseBodyFormData); //遍历,把必填项空的数据去掉 diff --git a/api-test/frontend/src/business/definition/components/document/components/ApiResponseInfo.vue b/api-test/frontend/src/business/definition/components/document/components/ApiResponseInfo.vue index 5fb87c4eaf..e990885535 100644 --- a/api-test/frontend/src/business/definition/components/document/components/ApiResponseInfo.vue +++ b/api-test/frontend/src/business/definition/components/document/components/ApiResponseInfo.vue @@ -52,7 +52,7 @@

+ v-html="formatRowData(apiInfo.responseBodyParamType, apiInfo.responseBodyStructureData)">