Skip to content

fix(web): enable JSON_OBJECT type support in console UI#2

Open
tomerqodo wants to merge 5 commits into
copilot_full_base_fixweb_enable_json_object_type_support_in_console_ui_pr2from
copilot_full_head_fixweb_enable_json_object_type_support_in_console_ui_pr2
Open

fix(web): enable JSON_OBJECT type support in console UI#2
tomerqodo wants to merge 5 commits into
copilot_full_base_fixweb_enable_json_object_type_support_in_console_ui_pr2from
copilot_full_head_fixweb_enable_json_object_type_support_in_console_ui_pr2

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#2

Copilot AI review requested due to automatic review settings January 25, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enables JSON_OBJECT type support in the console UI by modifying how JSON schemas are stored and validated for input variables. The changes remove a wrapper structure that was previously added around schema properties and instead store the full JSON schema directly.

Changes:

  • Added validation for JSON Schema inputs with two new error messages (invalid JSON and non-object type)
  • Removed the isSupportJSON flag to enable JSON Object type support for all non-basic apps
  • Updated JSON schema handling to store the complete schema structure instead of wrapping only the properties
  • Added translations for the new error messages across 22 language files

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

File Description
web/i18n/*/app-debug.json (22 files) Added translations for two new error messages: jsonSchemaInvalid and jsonSchemaMustBeObject
web/app/components/app/configuration/config-var/config-modal/index.tsx Modified JSON schema handling logic, removed feature flag, added validation for JSON object type, and implemented empty schema normalization
web/app/components/app/configuration/config-var/config-modal/config.ts Updated placeholder structure to show complete JSON schema format instead of just properties
Comments suppressed due to low confidence (1)

web/app/components/app/configuration/config-var/config-modal/index.tsx:91

  • The useMemo dependency array is missing 'type' as a dependency. The computed value 'jsonSchemaStr' depends on both 'type' and 'tempPayload.json_schema', but only the latter is included in the dependency array. This could lead to stale values if the type changes.
  const jsonSchemaStr = useMemo(() => {
    const isJsonObject = type === InputVarType.jsonObject
    if (!isJsonObject || !tempPayload.json_schema)
      return ''
    try {
      return JSON.stringify(JSON.parse(tempPayload.json_schema), null, 2)
    }
    catch {
      return ''
    }
  }, [tempPayload.json_schema])

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
handlePayloadChange('json_schema')(JSON.stringify(res, null, 2))
handlePayloadChange('json_schema')(value)
return True

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value 'True' should be 'true' in JavaScript/TypeScript. JavaScript uses lowercase 'true' as a boolean literal, not Python's capitalized 'True'.

Suggested change
return True
return true

Copilot uses AI. Check for mistakes.
const handleConfirm = () => {
const jsonSchemaValue = tempPayload.json_schema
const isSchemaEmpty = isJsonSchemaEmpty(jsonSchemaValue)
const normalizedJsonSchema = isSchemaEmpty ? undefined : jsonSchemaValue

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'normalizedJsonSchema' is declared but never used. It can be removed since the same logic is handled by 'payloadToSave' variable on the next lines.

Suggested change
const normalizedJsonSchema = isSchemaEmpty ? undefined : jsonSchemaValue

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants