fix(schema): 默认参数非必填

This commit is contained in:
baiqi 2024-07-16 10:17:35 +08:00 committed by Craftsman
parent 6dd5cf73f7
commit cc414e64dc
1 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ function createItem(key: string, value: any, parent?: JsonSchemaTableItem): Json
type: itemType, type: itemType,
description: '', description: '',
enable: true, enable: true,
required: true, required: false,
defaultValue: '', defaultValue: '',
example: exampleValue, // 仅当值不是对象或数组时,才赋予 example 值 example: exampleValue, // 仅当值不是对象或数组时,才赋予 example 值
parent, parent,
@ -135,7 +135,7 @@ export function parseJsonToJsonSchemaTableData(
type: Array.isArray(json) ? 'array' : 'object', type: Array.isArray(json) ? 'array' : 'object',
description: '', description: '',
enable: true, enable: true,
required: true, required: false,
example: '', example: '',
defaultValue: '', defaultValue: '',
}; };
@ -202,7 +202,7 @@ export function parseSchemaToJsonSchemaTableData(schema: string | JsonSchema): {
type: node.type, type: node.type,
description: node.description, description: node.description,
enable: true, enable: true,
required: true, required: false,
example: '', example: '',
defaultValue: '', defaultValue: '',
}; };