Skip to content

fix(frontend): allow null/undefined to pass enum validation for optional operator properties#5676

Open
rbelavadi wants to merge 2 commits into
apache:mainfrom
rbelavadi:fix/3524-optional-property-validation
Open

fix(frontend): allow null/undefined to pass enum validation for optional operator properties#5676
rbelavadi wants to merge 2 commits into
apache:mainfrom
rbelavadi:fix/3524-optional-property-validation

Conversation

@rbelavadi

Copy link
Copy Markdown

What changes were proposed in this PR?

Fix enum validator for optional operator properties.

Currently, the validator uses c.value ?? "" which coerces undefined to
empty string, then checks if "" is in the enum. Since empty string is
never a valid enum option, optional fields left blank always fail validation
and show a spurious error to the user.

Replace with c.value == null check — if the value is unset (null or
undefined), the field passes validation. Only run the enum check if the
user has actually entered a value.

Before: c.value ?? "" — coerces no-input to empty string, always fails
After: c.value == null || mapSource.enum?.includes(c.value) — allows unset values

Any related issues, documentation, discussions?

Fixes #3524

How was this PR tested?

Manually verified the logic change:

  • undefined == null evaluates to true, so unset optional fields now pass validation
  • A field with an actual value still gets checked against the enum
  • Existing test suite passes

Was this PR authored or co-authored using generative AI tooling?

Co-authored using Claude (Anthropic). The fix was reviewed and verified by the author.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first contribution to Texera, @rbelavadi!

If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

You can drive common housekeeping yourself by commenting one of these commands on its own line:

  • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
  • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
  • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling optional properties of operator

1 participant