feat: Update JSON Schema for expression component - #19254
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe expression JSON schema is updated to extend type union definitions ( ChangesExpression Schema Extensions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json (1)
37-46:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
anycurrently excludes list/object expressions, which blocks new function compositionLine 37-46 defines
#/definitions/anywithout#/definitions/strict-listand#/definitions/strict-object. That preventsfunc-list/func-objectoutputs from being used in positions typed asany(including Line 679 infunc-jmespath, and existingfunc-if/func-equalsarguments).Suggested fix
"any": { "title": "Any expression", "anyOf": [ { "type": "null", "title": "Null/missing value" }, { "$ref": "`#/definitions/strict-string`" }, { "$ref": "`#/definitions/strict-boolean`" }, { "$ref": "`#/definitions/strict-number`" }, + { "$ref": "`#/definitions/strict-list`" }, + { "$ref": "`#/definitions/strict-object`" }, { "$ref": "`#/definitions/func-if`" }, { "$ref": "`#/definitions/func-component`" }, { "$ref": "`#/definitions/func-dataModel`" }, { "$ref": "`#/definitions/func-jmespath`" } ] },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json` around lines 37 - 46, The anyOf array in the `#/definitions/any` section is missing references to strict-list and strict-object type definitions, which prevents func-list and func-object outputs from being used in positions typed as any. Add two new items to the anyOf array: a reference to `#/definitions/strict-list` and a reference to `#/definitions/strict-object`, alongside the existing references to strict-string, strict-boolean, strict-number, and the function definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json`:
- Around line 673-683: The func-jmespath schema definition is missing a minItems
constraint that enforces the required 2-argument (plus function name) structure.
The schema currently has items defined as a tuple array with additionalItems set
to false, but this allows fewer than the required 3 items. Add "minItems": 3 to
the func-jmespath schema object to ensure that invocations must include the
function name, data argument, and query string argument, rejecting malformed
calls that lack required parameters.
---
Outside diff comments:
In
`@src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json`:
- Around line 37-46: The anyOf array in the `#/definitions/any` section is missing
references to strict-list and strict-object type definitions, which prevents
func-list and func-object outputs from being used in positions typed as any. Add
two new items to the anyOf array: a reference to `#/definitions/strict-list` and a
reference to `#/definitions/strict-object`, alongside the existing references to
strict-string, strict-boolean, strict-number, and the function definitions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c513f8d4-54ab-4083-8a4f-ca1c0bdf8fd4
📒 Files selected for processing (1)
src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19254 +/- ##
==========================================
+ Coverage 95.84% 95.88% +0.03%
==========================================
Files 3028 3035 +7
Lines 39819 39763 -56
Branches 4910 4901 -9
==========================================
- Hits 38166 38128 -38
+ Misses 1235 1222 -13
+ Partials 418 413 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
This pull request updates the JSON Schema used in the expression editor in Studio with the new
list,objectandjmespathfunctions.Current:

This pull request:

Verification
Summary by CodeRabbit
Release Notes
jmespathform (data to query plus query string)