Skip to content

Commit

Permalink
fix(dop): api market table desc and default does not display (erda-pr…
Browse files Browse the repository at this point in the history
…oject#2077) (erda-project#2078)

Co-authored-by: hujiahao-hjh <82502479+hujiahao-hjh@users.noreply.github.com>
  • Loading branch information
erda-bot and hujiahao-hjh authored Nov 23, 2021
1 parent 88fed11 commit 0eff240
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export interface IParameters {
format?: string;
example?: string;
enum?: any[];
default: string;
description: string;
};
}

Expand Down Expand Up @@ -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,
});
});
});
Expand Down

0 comments on commit 0eff240

Please sign in to comment.