mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 15:57:06 +08:00
chore: remove transform boolean to string in editor
This commit is contained in:
parent
5b895be412
commit
1e18c828d9
@ -11,7 +11,6 @@ import VisualEditor from './visual-editor'
|
|||||||
import SchemaEditor from './schema-editor'
|
import SchemaEditor from './schema-editor'
|
||||||
import {
|
import {
|
||||||
checkJsonSchemaDepth,
|
checkJsonSchemaDepth,
|
||||||
convertBooleanToString,
|
|
||||||
getValidationErrorMessage,
|
getValidationErrorMessage,
|
||||||
jsonToSchema,
|
jsonToSchema,
|
||||||
preValidateSchema,
|
preValidateSchema,
|
||||||
@ -87,7 +86,6 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
|||||||
setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`)
|
setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
convertBooleanToString(schema)
|
|
||||||
const validationErrors = validateSchemaAgainstDraft7(schema)
|
const validationErrors = validateSchemaAgainstDraft7(schema)
|
||||||
if (validationErrors.length > 0) {
|
if (validationErrors.length > 0) {
|
||||||
setValidationError(getValidationErrorMessage(validationErrors))
|
setValidationError(getValidationErrorMessage(validationErrors))
|
||||||
@ -168,7 +166,6 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
|||||||
setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`)
|
setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
convertBooleanToString(schema)
|
|
||||||
const validationErrors = validateSchemaAgainstDraft7(schema)
|
const validationErrors = validateSchemaAgainstDraft7(schema)
|
||||||
if (validationErrors.length > 0) {
|
if (validationErrors.length > 0) {
|
||||||
setValidationError(getValidationErrorMessage(validationErrors))
|
setValidationError(getValidationErrorMessage(validationErrors))
|
||||||
|
|||||||
@ -303,6 +303,7 @@ export const getValidationErrorMessage = (errors: ValidationError[]) => {
|
|||||||
return message
|
return message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Previous Not support boolean type, so transform boolean to string when paste it into schema editor
|
||||||
export const convertBooleanToString = (schema: any) => {
|
export const convertBooleanToString = (schema: any) => {
|
||||||
if (schema.type === Type.boolean)
|
if (schema.type === Type.boolean)
|
||||||
schema.type = Type.string
|
schema.type = Type.string
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user