From 0eff240ed8453130a5353cceee88f744afa0ec38 Mon Sep 17 00:00:00 2001 From: erda-bot <81558540+erda-bot@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:38:20 +0800 Subject: [PATCH] fix(dop): api market table desc and default does not display (#2077) (#2078) Co-authored-by: hujiahao-hjh <82502479+hujiahao-hjh@users.noreply.github.com> --- .../detail/components/api-preview-3.0.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx index 1b7eb0645e..0e19b9a258 100644 --- a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx +++ b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx @@ -39,6 +39,8 @@ export interface IParameters { format?: string; example?: string; enum?: any[]; + default: string; + description: string; }; } @@ -248,13 +250,20 @@ export const parseOpenApi3 = (dataSource: IDataSource): IParseOas3 => { info[paramsName] = info[paramsName] ? info[paramsName] : []; forEach(items, (item) => { const { name, required, schema, description: paramsDesc } = item; - const { type, example, enum: paramsEnum } = schema || { type: 'string' }; + const { + type, + example, + enum: paramsEnum, + default: defaultValue, + description: desc, + } = schema || { type: 'string' }; info[paramsName].push({ name, required: required ? i18n.t('common:yes') : i18n.t('common:no'), type: { value: type, enum: paramsEnum }, - description: paramsDesc, + description: desc || paramsDesc, defaultValue: example, + default: defaultValue, }); }); });